Php: how to move uploaded images
Reply to discussion (solution)
Move_uploaded_file ($ _ FILES ['photo '] ['tmp _ name'], $ target_image)
$ Target_image is the image address on the server, that is, the location you want to move
Move_uploaded_file ($ _ FILES ['photo '] ['tmp _ name'], $ target_image)
$ Target_image is the image address on the server, that is, the location you want to move
I'm talking about a folder that has been uploaded. How can I move it.
You can directly use php to call system commands,
Exec ("mv-f/path/old.jpg/path/new.jpg ");
You can directly use php to call system commands,
Exec ("mv-f/path/old.jpg/path/new.jpg ");
Is there no function method ???
Okay.
Rename ()
However, I always think that using system commands is faster, especially when processing large files.
Use the rename function.
Okay.
Rename ()
However, I always think that using system commands is faster, especially when processing large files.
Rename ("cs/temporaryPicture/". $ picturename [I], "cs/picture/". $ picturename [I]);
No. Always wrong
Use the rename function.
No, an error occurred.
What ???
Yes? Limit?
I want to hear from you!
What do you do? do you have to post the code?
If something goes wrong, do you have to give an error message?
I want to hear from you!
What do you do? do you have to post the code?
If something goes wrong, do you have to give an error message?
Warning: rename (cs/temporaryPicture/, cs/picture/) [function. rename]: No error in E: \ AppServ \ www \ test1 \ sendjobpicture. php on line 14
Use absolute paths. now you are using relative paths.
What ???
Yes? Limit?
Warning: rename (cs/temporaryPicture/, cs/picture/) [function. rename]: No error in E: \ AppServ \ www \ test1 \ sendjobpicture. php on line 14
Use absolute paths. now you are using relative paths.
Absolutely not.
Your $ picturename [I] is empty!
Cs/temporaryPicture/is the path, not the file (directory) name
How can this problem be solved?
Your $ picturename [I] is empty!
Cs/temporaryPicture/is the path, not the file (directory) name
How can this problem be solved?
Yes, it is empty. Oh, I understand. Thank you.