I want to upload an image on a remote host (Everything is ok locally).
I've used the code below like my other previous projects to do it:
if (move_uploaded_file($_FILES["scan"]["tmp_name"], 'images/scans/1.jpg')) {
chmod ('images/scans/1.jpg','0644');
}
But every time I run this code in the internet, I get an error:
Warning: move_uploaded_file(images/profile/Mordent.jpg) [function.move-uploaded-file]: failed to open stream: Permission denied in ...
I have to change scans
directory permission to 0777 and then I can upload images. Otherwise I can not. It's very strange for me. I've used this code in many times in different projects and I had not any problem with it.