To do a business, you need to extract data from the user's uploaded Excel, but you don't need to save Excel.
I read the data by uploading temporary files $_files[' Excel ' [' Tmp_name ']. But will this temporary file be erased automatically? If it is automatically cleared, how long is the temporary file valid, and which directory is the temporary upload file for PHP (installed via Yum) under Linux (CentOS)?
Thank the Great God!
Reply to discussion (solution)
Yes, it will be cleared automatically. When the request ends, it is deleted.
Under Linux you can use Phpinfo (); View the location of the temp directory
The expiration date should be Linux management.
The request ends when it is deleted. Personal feel to save files directly when finished using delete better control.
After the user uploads the file, saves the data, ulink the temporary file.
$_files[' Excel ' [' tmp_name '] means the absolute path of the upload temporary file
The lifetime of the upload temporary file is the same as the PHP program that handles the upload (that is, the program ends and the temp file disappears)
Move_uploaded_file function to make temporary files disappear prematurely
Really useful, thanked the great God.