PHP + FLASH file Upload progress bar-related file downloads _ PHP Tutorial

Source: Internet
Author: User
Tags file upload progress bar
PHP + FLASH implements file download related to the upload progress bar. PHP is difficult to implement the upload progress bar because when we upload files to the server, we need to wait until all the files are sent to the server before executing the corresponding PHP file. Before that, PHP was difficult to implement the upload progress bar because when we uploaded files to the server, we had to wait until all the files were sent to the server before executing 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.

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

Bytes. Before that ,...

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