Question about move_uploaded_file

I use this code one site:

 move_uploaded_file($_FILES["file".$i]["tmp_name"],
      $_SERVER['DOCUMENT_ROOT'] . '/newrosoft-site/admin/upload/'. $_FILES["file".$i]["name"]);
      echo "Stored in: " . $_SERVER['DOCUMENT_ROOT'] . '/newrosoft-site/admin/upload/'. $_FILES["file".$i]["name"];

and I get an error like(even the folders exist):

Warning: move_uploaded_file(/var/www/b-0_info/admin/upload/apply_f2.png) [function.move-uploaded-file]: failed to open stream: No such file or directory in /var/www/b-0_info/newrosoft-site/admin/iphone-admin.php on line 304

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move ‘/tmp/php7YqyuY’ to ‘/var/www/b-0_info/admin/upload/apply_f2.png’ in /var/www/b-0_info/newrosoft-site/admin/iphone-admin.php on line 304
Stored in: /var/www/b-0_info/admin/upload/apply_f2.png

Can someone, please, tell me why?

I changed yesterday the rights with chmod, on that folder. On the server I can see that I have full rights on the folder. I don’t understand.

It appears, Apache cannot read/see the file.

http://b-0.info/newrosoft-site/admin/upload/

Check the permissions and read the documentation for [fphp]chmod/fphp.

:slight_smile:

I can put images on database and on the folder but I can’t see any image on and website page.
This is from web page source:

<img src="http://example.com/newrosoft-site/admin/upload/edit_f2.png" alt="Imagine" id="10"  />

so, I have the image there, but what I can see is only the text from alt.
What can I do?

Yes, I have 777 to that folder.

Does PHP have access to write into /var/www/b-0_info/admin/upload/ ?