Php $

Source: Internet
Author: User
I think people who want to share the same idea with me will do this: The uploaded files only need to be used temporarily and do not need to save the original files for backup, such as resize, in addition, these subsequent operations will be performed only during the second round of requests from the client. For example, first upload and return the path of the uploaded temporary file to the browser, the user clicks and then operates on the temporary file; however

I think people who want to share the same idea with me will do this: The uploaded files only need to be used temporarily and do not need to save the original files for backup, such as resize, in addition, these subsequent operations will be performed only during the second round of requests from the client. For example, first upload and return the path of the uploaded temporary file to the browser, the user clicks and then operates on the temporary file; however

I think people who want to share the same idea with me will do this: The uploaded files only need to be used temporarily and do not need to save the original files for backup, such as resize, in addition, these subsequent operations will be performed only during the second round of requests from the client. For example, first upload and return the path of the uploaded temporary file to the browser, the user clicks and then operates on the temporary file. However, in actual implementation, it is found that the temporary file does not exist during the second round of requests and is not found in the Temporary Folder.


I have also encountered this problem in a q group, and the cause is similar to my implementation idea. So I have a question: How does one upload files?


I don't want to see the php implementation code. I probably thought about it. It should be a collection mechanism: After clicking on a temporary file space, php should maintain its own collection of this space;


So I tried to upload a huge file, which is large enough for php to run for a long time. I thought I would see it in a temporary folder. unfortunately, I didn't even see it until php returned: Because this file has exceeded the upload limit; then I uploaded it using a small file and printed its Temporary Folder path, it was found that it started with php and ended with tmp;

I thought of a way to use while to get stuck in uploading php. This process will return for a certain amount of time. This time I saw the temporary file in the Temporary Folder, which is indeed in php **. tmp,


If the php Parsing is aborted by refreshing the Abnormal end of the page during php running, the temporary file will be permanently retained,

If php ends normally, the file will be deleted at the end of php.

At the same time, I felt that this file appeared again after the upload was completed: I could not see it from the figure of uploading a large file;


Therefore, php's temporary file maintenance method is to reclaim resources from the end of php. If you want to use this file in the second round of requests, you should move it yourself to maintain this file,

In this test, we did not test the time at which php include contains multiple nesting conditions.

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.