Jump to content

Upload Script Not Working Anymore


refiking

Recommended Posts

I have a script that runs on my development server (linux), but won't work on the live environment (iis).  I checked the php.ini settings and they are fine.  I even echoed the tmp name for the uploaded file and that shows, but it's not moving the file and I don't know how (if it's even possible) to display the reason why it's not doing so.  What can I check or alter?  Here's a snippet of the code:

 

echo "Temp file: " . $_FILES['uploadFile'. $x]["tmp_name"] . "<br />";
$copy = move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], 'uploads/' . $file_name);

Link to comment
https://forums.phpfreaks.com/topic/185325-upload-script-not-working-anymore/
Share on other sites

Thanks, but yeah permissions are set.  I just did another google search and think I might've found the problem but still not the solution.  The live environment is Windows IIS and the test environment is linux.  And the temporary folder for windows retains the permissions of windows and not of the site.  Anyone have any experience with this kind of thing or a solution for it?

Do some debugging, display all php detected errors. Temporarily add the following two lines of code immediately after your first opening <?php tag -

 

ini_set("display_errors", "1");
error_reporting(E_ALL);

 

What does the ['error'] element of the $_FILES array show? Any upload errors?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.