0

I'm trying to get website to upload images and I'm getting this error:

[Fri Oct 23 21:42:30.075831 2015] [:error] [pid 18652] [client ::1:64412] PHP Warning:move_uploaded_file(): Unable to move '/private/var/tmp/php0HlxVu' to 'images/photo.jpg' in /Users/ridgefrancis/Sites/examples/ch05/initial/guitarwars/addscore.php on line 32, referer: http://localhost/~ridgefrancis/examples/ch05/initial/guitarwars/addscore.php

I've seen the solution to this question already here:
move_uploaded_file gives "failed to open stream: Permission denied " error after all configurations i did

In my attempt to follow these instructions to fix the problem I ran into another problem,

tmp_file_upload file/folder doesn't exist. 

What do I do in a case like this?

Thanks in advance!

Mekanic
  • 137
  • 2
  • 10
  • I guess images/ folder does not have file access permission. This is very common error while we are uploading files to the server. – Jitendra Kumar. Balla Oct 24 '15 at 04:50
  • change the permission and try – Pathik Vejani Oct 24 '15 at 04:59
  • I changed the permissions on the images folder already but I have to also change the permissions on the tmp_file_upload folder but it doesn't exist. In a case where the tmp_file_upload file doesn't exist what are my options to getting around to this problem? – Mekanic Oct 24 '15 at 05:01

1 Answers1

0

I was thinking that my upload was not working because of my tmp_file_upload folder but it wasn't. I searched the internet and found out that ppl suggested it was because of that folder.

This piece of code solved my problem.

sudo chmod -R a+w /PATH/TO/IMAGE/FOLDER

I hope it helps someone in the future with the same issue.

Mekanic
  • 137
  • 2
  • 10