hi, there! I have a script that basically tries to upload a file to the server. But when the move_uploaded_function is called, it returns these errors:
Warning: move_uploaded_file(../Main/ImgStiri/ceva.jpg): failed to open stream: Permission denied in /home/gotech/public_html/Nou/functii.php on line 81 Warning: move_uploaded_file(): Unable to move '/tmp/phpQdW26l' to '../Main/ImgStiri/ceva.jpg' in /home/gotech/public_html/Nou/functii.php on line 81 (Quick note: I'm a newbie to linux and apache, the sever that my host is running. I know I'm an idiot for using Windows and IIS locally fot testing, I'll switch as soon as possible. But the important thing is that it works on IIS). The code is as follows: function HandleImage($name, $caleDest) { if((isset($_FILES[$name]['tmp_name'])) && ($_FILES[$name]['tmp_name'] != '')) { $caletmp = $_FILES[$name]['tmp_name']; $numeFis = basename($_FILES[$name]['name']); return MutaFisier($caletmp, $caleDest, $numeFis); } else return ''; } function MutaFisier($caletmp, $calenoua, $numeFis) { chmod($caletmp,0777); //tried to grant full access to the temporary folder, but it proved useless - i also tried the same on the destination folder, and php issued an error $fisiernou = $calenoua.$numeFis; if(!file_exists($fisiernou)) move_uploaded_file($caletmp, $fisiernou); //the error occurs here // other stuff } So, if you could tell me what the difference is between IIS and apache concerning file uploads, i'd be grateful. Or tell me what I'm doing wrong - because i'm kind of stuck... Thanks a million. Mike