PHP $_files temporary storage file and recovery mechanism measurement process _php Tutorial

Source: Internet
Author: User
Tags tmp file
I think someone who thinks the same as I do this: the uploaded files just want to use temporarily, do not need to save the original files, such as resize, and these late operations will appear in the second round from the client request to operate, such as first upload, upload the temporary file path back to the browser, The user clicks on the temporary file to operate, but in the actual implementation found that the temporary file in two rounds of requests, unexpectedly did not exist, ran to the temporary folder to view and did not find.

I also met someone in a Q group who asked this question, and the reason is similar to my idea of this realization. So, there is a doubt, how to upload a file is the principle?
Do not want to see PHP implementation code, I think about the next, it should be a recycling mechanism: Click on the temporary file space, then, PHP itself should maintain the recovery of this space;

So I try to upload a huge file, big enough to let PHP run for a long time, I thought I would see it appear in the temporary folder. Unfortunately, I did not see it figure until PHP returns: Because this file exceeds the upload limit, and then I use the small file upload to print out its temporary folder path, found that it is the beginning of PHP, with the end of TMP file naming method;

I thought of a way to use while stuck uploading PHP this process for a certain amount of time to return, which I saw temporary files in the temporary folder, it is indeed named Php**.tmp,

If PHP parsing is aborted by using the normal end of PHP to refresh the page in the course of running, the temporary file will be permanently preserved.
If PHP is the normal end of the session, this file will be deleted at the end of PHP.

At the same time, I feel that this file should be uploaded after the completion of the upload: from my upload large files can not see its figure inference;
Therefore, the temporary file maintenance of PHP is PHP at the end of the recovery of resources, want to use this file in the second round of requests, should be moved after the maintenance of this file,
In this test, it was not tested when PHP include more than one nested case, at what time to recycle.

http://www.bkjia.com/PHPjc/328046.html www.bkjia.com true http://www.bkjia.com/PHPjc/328046.html techarticle I think someone who thinks the same as I do this: the uploaded files just want to use temporarily, do not need to save the original files, such as resize, and these later operations will appear ...

  • 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.