Php+flash implementation upload file progress bar related file download _php tips

Source: Internet
Author: User
PHP is very difficult to upload the progress bar because when we upload files to the server, to wait until the file is all sent to the server, before the corresponding PHP file execution. Before that, the file data was saved in a temporary file, and PHP could not get the path and size of the file.
Starting with ActionScript 2.0, Flash support files are uploaded and downloaded. Although it is not possible to get file upload progress on the server side, we can get the file delivery progress on the server side. According to this principle, use flash can 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 predecessors to strengthen the security and robustness of the program, and added some customizable parameters.

Description: If your computer has firewall software installed, you may see the progress bar on the 100%. This is because the progress bar shows the speed at which flash passes files to the firewall software! The firewall will also upload data to the server.
Demo Please click here


This procedure is Longbill according to the on-line related material improvement to become
http://www.longbill.cn
Email:longbill.cn@gmail.com

Invoke parameter description (assuming this flash name is upload.swf):

Write the call address of the Flash file:
upload.swf?maxsize=[Single File maximum volume]&bgcolor=[progress bar color]
&limit=[limit upload file type]&savefile=[upload object file]

[Maximum single file size]: "Optional" number (in kilobytes)
[Progress bar color]: "Optional" "six-digit hexadecimal number" "Default to Random Color" (16-bit color value without #)
[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

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.