I have a problem with my PHP code.
I have a form that lets the user upload files to the server, but I did not know how to write the correct path for that folder in the server! [Enter image details here] [1] Which I want to put files in the store, how to get to the path of a specific file to download later.
The path to the server: / public_html / upload_files
but it keeps telling me:
Warning: move_uploaded_file (upload_files / project_guidelines. PDF): Failed to open the stream: There is no such file or directory in the line at D: \ sites \ dwts.com \ public_html \ website \ creat.php 50 Warning: move_uploaded_file (): 'C: \ Windows \ Temp' Unable to move \ Php14AC.tmp 'to' upload_files / project_guidelines.pdf 'in the file: d: \ sites \ dwts.com \ public_html \ website \ creat.php line 50 error upload file
< / Blockquote>code:
$ len = count ($ _files ['attachment'] ['name']); ($ $ = $; $ I & lt; $ len; $ i ++) for {$ uploadDir = 'upload_files /'; $ FileName = $ _FILES ['Attachments'] ['Name'] [$ i]; $ TmpName = $ _FILES ['Attachments'] ['tmp_name'] [$ i]; $ FileSize = $ _FILES ['Attachments'] ['Size'] [$ i]; $ FileType = $ _FILES ['Attachments'] ['Type'] [$ i]; $ FilePath = $ Uploaddear basename ($ _ files ['attachment'] ['name'] [$ i]); $ Result = step_upload_file ($ tmpName, $ filePath); If (! $ Results) {echo "error uploading file"; Go out; }
Thanx
$ UploadDir = 'upload_files /';
Where is the drive? Its Windows, therefore it needs to drive:
$ uploadDir = 'c: / upload_files /';
You can not assign a second part of the second argument to move_uploaded_file
... it requires a full path.
No comments:
Post a Comment