How PHP moves an uploaded image

Source: Internet
Author: User
How PHP moves images that have already been uploaded


Reply to discussion (solution)

Move_uploaded_file ($_files[' photo ' [' tmp_name '], $target _image)
$target _image is the address of the picture on the server, which is the location you want to move

Move_uploaded_file ($_files[' photo ' [' tmp_name '], $target _image)
$target _image is the address of the picture on the server, which is the location you want to move



I'm talking about an already uploaded file that's already in a folder. May I ask how to move.

You can call the system command directly in PHP,
EXEC ("Mv-f/path/old.jpg/path/new.jpg");

You can call the system command directly in PHP,
EXEC ("Mv-f/path/old.jpg/path/new.jpg");



Excuse me, is there a way to use the function???

All right
Rename ()
But I always feel that using the system command will be faster, especially to handle large files.

With the rename function, of course.

All right
Rename ()
But I always feel that using the system command will be faster, especially to handle large files.



Rename ("Cs/temporarypicture/". $picturename [i], "cs/picture/". $picturename [i]);

Oh, no. It always goes wrong.

With the rename function, of course.



No, it's wrong.

What's wrong???
Is there a limit?

I see how you're going to bark!
What do you do, gotta put the code on it?
There's a problem, you gotta give me the wrong message?

I see how you're going to bark!
What do you do, gotta put the code on it?
There's a problem, you gotta give me the wrong message?



Warning:rename (cs/temporarypicture/,cs/picture/) [Function.rename]: No error in E:\AppServ\www\test1\ sendjobpicture.php on line 14

With the absolute path, you are now using a relative path.

What's wrong???
Is there a limit?



Warning:rename (cs/temporarypicture/,cs/picture/) [Function.rename]: No error in E:\AppServ\www\test1\ sendjobpicture.php on line 14

With the absolute path, you are now using a relative path.




Absolutely not.

Your $picturename [i] is empty!

Cs/temporarypicture/is a path, not a file (directory) name
How can it be?

Your $picturename [i] is empty!

Cs/temporarypicture/is a path, not a file (directory) name
How can it be?




Yes, it's empty. Oh, I see. Thank you.
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.