Hi, I am submitting a form (which creates a directory). That part parts works like a charm. Then, I am trying to upload my files in that directory. Both are going to be on the same page. Yet, the files refuse to go inside my create directory. I don't get it. This is the error message from the console.
Warning: mkdir() [<a href='function.mkdir'>function.mkdir</a>]: No such file or directory in <b>/home/*****/*****/*****/upload.php on line 7 has NOT been created
Warning: file_put_contents(images/$folder/saskype_bla.jpeg) [<a href='function.file-put-contents'>function.file-put-contents</a>]: failed to open stream: No such file or directory in /home/*****/*****/*****/upload.php on line 41
Something went wrong. Check that the file isn't corrupted
Sami Dma wrote:I tried also with 777, but to no avail. As for your suggestion, how do you even do that? I've never heard of that before.
Do what? chown in PHP? Just like you mkdir.
Further inspection, your $folder goes in the images folder. And from the error what does this evaluate to? images/$folder/saskype_bla.jpeg? Is this the correct path?
K. Tsang CEng MBCS PMP PMI-ACP OCPJEA OCPJP
posted 6 years ago
No, it doesn't do that. I ensured myself that it wouldn't do that. It just doesn't save the file at all. With the code I have now, I can create a folder (in the same directory as my images folder), and I can save my image in the images folder.
Yes, as well as
Check the owner of this directory against the apache user or whichever account runs apache HTTP server.