Question

I have an image uploader which works fine on localhost through WAMP but when I push it live it doesn't work. Instead of having a temporary name like:

[tmp_name] => C:\wamp\tmp\php53BF.tmp

It will return this:

[tmp_name] => /tmp/phpxfvHuw

I've checked my php.ini file and:

  1. File upload size is 128mb (Plenty high enough)
  2. File upload is enabled
  3. I have enctype="multipart/form-data" in my form.
  4. In $_FILES the error level is set to 0 which means there's no error.

What else could cause such an issue?

Was it helpful?

Solution

Check and make sure the folder you are uploading to has the proper permissions, you can do this with a simple chmod r 777 command. May I suggest permission on the upload folder be 775. This should give both the apache and FTP users the ability to write to the files in the folder but keep everyone else from modifying them.

You can always checked the (move_uploaded_files)'s ['error'] index for any errors that you may experience. If it is 0, then your upload was successful.

Check out this article if you need more information, http://www.w3schools.com/php/php_file_upload.asp

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top