How does php Upload a compressed file? Give an instance.

Source: Internet
Author: User
How does php Upload a compressed file? I got an instance from the internet. I don't know where I was wrong and I didn't specify where to upload it.

Form part
 



Singleupload. php
If (move_uploaded_file ($ _ FILES ['upfile'] ['tmp _ name'], $ _ FILES ['upfile'] ['name']) {echo "file uploaded successfully!

";} Else {echo" file Upload failed!

";}


Reply to discussion (solution)

$ _ FILES ['upfile'] ['name']
Do you want to copy the temporary file to the original path of the uploaded file? Doomed to copy failure...

$ _ FILES ['upfile'] ['name']
Do you want to copy the temporary file to the original path of the uploaded file? Doomed to copy failure...

I don't quite understand a few questions. we all say that move_uploaded_file can be used for uploading.
But how does move_uploaded_file specify where the file comes from and where it comes from.

The server path is: D: \ phpnow \ htdocs \ wpgc \ wp-content \ files
Files directory on the server ..

Is singleupload. php in the files directory?

Is singleupload. php in the files directory?

No
Singleupload. php in D: \ phpnow \ htdocs \ wpgc \ wp-content \ themes \ MyBlog

If (move_uploaded_file ($ _ FILES ['upfile'] ['tmp _ name'], "... /.. /files /". $ _ FILES ['upfile'] ['name']) {

If (move_uploaded_file ($ _ FILES ['upfile'] ['tmp _ name'], "... /.. /files /". $ _ FILES ['upfile'] ['name']) {

Thank you very much for your success.
It means that when you click submit, the file has been uploaded, but uploaded to the current directory, that is, the temporary directory.
Is move_uploaded_file used to copy files to the desired directory?

Move_uploaded_file is mobile
Copy_uploaded_file is a copy.

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.