Php+flash Implement upload file progress bar related files Download _php tutorial

Source: Internet
Author: User
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, ...

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