I have a script attached which is intended to upload an image file to a folder, but it must create a subfolder named after the primary index record id of the user. The receiving folder "memberFiles" has been CHMODed to 777. I am using an Apache server. I get this error message. Warning: move_uploaded_file(memberFiles/20/pix.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in /hermes/bosweb/web121/b1215/ipg.skillsatschoolcom/demonstration/admin_login/edit_pic.php on line 31 Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phppkedff' to 'memberFiles/20/pix.jpg' in /hermes/bosweb/web121/b1215/ipg.skillsatschoolcom/demonstration/admin_login/edit_pic.php on line 31 Error. Any help and good advice would be much appreciated.
Before you try to move uploaded file, first try to create folder (like in this error said, memberFiles/20/) with mkdir.
The problem with that approach is that I need to create a unique folder for each upload... but maybe not. I think I see the light. I can name the file by referring to the logged in id for the variable. It will still be a unique filename. I'll try that, but not tonight. Thanks for your comment.
I have solved this myself. As usual, after two days of struggle, the solution was so simple. Question: How do I mark this as solved?
I really don't see the relevance of referring to getcwd(). Would you like to explain, and in the context of the thread?