简体   繁体   中英

move_uploaded_file does not working on windows server

I know this question is so common in stackoverflow and many questions are available on this topic, but still I did not match any answer solving my strange prblem.

$path = "img/"
$tmp = $_FILES ['footer-bg-img'] ['tmp_name'];
move_uploaded_file ( $tmp, $path . $actual_image_name );

its working fine on my local system both WAMP and XAMPP application, but on my windows web server it returns false , which makes me strange, on my web server I printed the function output, it gives me

string(27) "C:\\Windows\\Temp\\phpAA55.tmp" string(21) "/img/20131208_bjp.jpg" bool(false) dead

I have asked the service provider to give the img folder 0777 permission, they told me they have done that. But having still same problem, now should I contact the service provider or there could be coding error, please suggest.

I still think its a permissions issue. Please have a look at the following topic: move_uploaded_file() returns false

You can also check the permissions to the directory with PHP function:

if ( ! is_writeable ( $path ) )
{
    echo 'Can\'t write to directory, insufficient permissions.';
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM