PHP is very difficult to implement the upload progress bar is because when we upload files to the server, we have to wait until all the files are sent to the server, the corresponding PHP files are executed. Before that, the file data is stored in a temporary file, and PHP cannot get the path and size of the file.
Starting with ActionScript 2.0, Flash supports file uploads and downloads. Although it is not possible to get the file upload progress on the server, we can get the progress of sending the file on the server. According to this principle, flash can be used to make upload progress bar effect.
I have seen some information on the internet, but I feel defective. So I studied it, on the basis of the predecessors to enhance the security and robustness of the program, and added some customizable parameters.
Note: If your computer has firewall software installed, you may see a progress bar of 100%. This is because the progress bar shows the speed at which Flash transmits files to the firewall software! The firewall also uploads data to the server.
Demo Please click here
This procedure is Longbill according to the online related information to improve
http://www.longbill.cn
Email:longbill.cn@gmail.com
Call parameter description (assuming this flash name is upload.swf):
Write the calling address of the Flash file:
upload.swf?maxsize=[Single File Max volume]&bgcolor=[progress bar color]
&limit=[limit upload file type]&savefile=[upload object file]
[Single file maximum volume]: "Optional" "number" in kilobytes (KB)
[Progress bar color]: "Optional" "six-digit hexadecimal number" "Default to Random Color" (No # 16-bit color value)
[Limit upload file type]: "Optional" format such as: Limit=zip|rar|doc
[Upload Object file]: "Default is save.php" "string"
For example:
upload.swf?maxsize=2048&bgcolor=ff00ff&limit=jpg|gif|png&savefile=upsave.php
Package file Download
http://www.bkjia.com/PHPjc/318477.html www.bkjia.com true http://www.bkjia.com/PHPjc/318477.html techarticle PHP is very difficult to implement the upload progress bar is because when we upload files to the server, we have to wait until all the files are sent to the server, the corresponding PHP files are executed. Before this, ...