PHP + FLASH implements file download on the upload progress bar

Source: Internet
Author: User
PHP + FLASH Upload file progress bar File Download PHP is difficult to achieve the upload progress bar because when we upload files to the server, we have to wait until all the files are sent to the server, to execute the corresponding php file. Before that, the file data is stored in a temporary file, and php cannot obtain the path and size of the file.
Flash supports uploading and downloading files starting with Actionscript 2.0. Although the file upload progress cannot be obtained on the server side, we can get the file sending progress on the server side. Based on this principle, you can use Flash to make the upload progress bar effect.
I have seen some materials on the Internet, but I feel defective. So I studied it myself and strengthened the security and robustness of the program based on the predecessors, and added some customizable parameters.

Note: If firewall software is installed on your computer, you may see a progress bar of 100%. This is because the progress bar shows the speed at which flash uploads files to the firewall software! The firewall also transmits data to the server.
Click here for demonstration


This program was developed by Longbill based on relevant online materials.
Http://www.longbill.cn
Email: longbill.cn@gmail.com

Call parameter description (assuming the flash name is upload.swf ):

Write the call address of the flash file as follows:
Upload.swf? Maxsize = [maximum volume of a single file] & bgcolor = [progress bar color]
& Limit = [restrict upload file types] & savefile = [Upload object files]

[Maximum size of a single file]: [optional] [number] (unit: KB)
[Progress bar color]: [optional] [six-digit hexadecimal number] [random color by default] (no #16-digit color value)
[Restrict the Upload file type]: [optional] format: limit = zip | rar | doc
[Upload object files]: [save. php by default] [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.