Upload Progress Bar in PHP

Does anyone know how to get a progress bar for an upload in php? I am trying writing code for a photo album uploader. I would like a progress bar to display while the photos are uploading.

I am fairly new to php so I dont know everything about it.

Questo articole è stato pubblicato in Uncategorized e contrassegnati , , . Bookmark della Permalink.

19 Responses to Upload Progress Bar in PHP

  1. Josh Curren dice:

    I just found Mega Upload (http://www.raditha.com/php/progress.php) which uses perl do the uploading and display a progress bar.

  2. Valdelievre dice:

    Another uploader full JS : http://developers.sirika.com/mfu/

    • Its free ( BSD licence )
    • Internationalizable
    • cross browser compliant
    • you have the choice to install APC or not ( underterminate progress bar VS determinate progress bar )
    • Customizable look as it uses dojo template mechanism. You can add your class / Ids in the te templates according to your css

    have fun

  3. Steve-o dice:

    Gears and HTML5 have a progress event in the HttpRequest object for submitting a file upload via AJAX.

    http://code.google.com/apis/gears/api_httprequest.html#HttpRequestUpload
    http://developer.mozilla.org/en/Using_files_from_web_applications

    Your other options as already answered by others are:

    1. Flash based uploader.
    2. Java based uploader.
    3. A second comet-style request to the web server or a script to report the size of data received. Some webservers like Lighttpd provide modules to do this in-process to save the overhead of calling an external script or process.

    Technically there is a forth option, similar to YouTube upload, with Gears or HTML5 you can use blobs to split a file into small chunks and individually upload each chunk. On completion of each chunk you can update the progress status.

  4. Joey Robert dice:

    You would need to use Javascript to create a progress bar. A simple Google search led me to this article: WebAppers Simple Javascript Progress Bar with CSS.

    Dojo File Upload Progress Bar Widget is another option using the Dojo Javascript framework.

    EDIT: Assuming your uploading a large number of images (such as a photo album), and POSTing them to your PHP script, you could use javascript to read the results back from the post and update the progress bar based on the number of images uploaded / total number of images. This has the side effect of only updating after each post has completed. Check out here for some info on how to post with JS.

  5. Ali Lown dice:

    A php/ajax progress bar can be done. (Checkout the Html_Ajax library in pear).
    However this requires installing a custom module into php.

    Other methods require using an iframe, through which php looks to see how much of the file has been uploaded. However this hidden iframe, may be blocked by some browsers addons because hidden iframes are often used to send malicious data to a users computer.

    Your best bet is to use some form of flash progress bar if you do not have control over your server.

  6. WishCow dice:

    Christian Stocker also made a PHP module to help analysing file uploads: http://blog.liip.ch/archive/2009/01/22/uploadprogress-0-9-2-released.html

  7. nibuster dice:

    flash upload will do the job. it will upload file where you want. But there is more demands than that for me. i need to change filename before upload is complete. this is also possible with flash solution BUT ONLY if you are adding FIXED variable. I need to add user ID to a filename and i see no way to do it.

  8. Valdelievre dice:

    I just found Mega Upload (http://www.raditha.com/php/progress.php) which uses perl do the uploading and display a progress bar.

  9. johnboy dice:

    Christian Stocker also made a PHP module to help analysing file uploads: http://blog.liip.ch/archive/2009/01/22/uploadprogress-0-9-2-released.html

  10. Steve-o dice:

    I just found Mega Upload (http://www.raditha.com/php/progress.php) which uses perl do the uploading and display a progress bar.

  11. johnboy dice:

    You would need to use Javascript to create a progress bar. A simple Google search led me to this article: WebAppers Simple Javascript Progress Bar with CSS.

    Dojo File Upload Progress Bar Widget is another option using the Dojo Javascript framework.

    EDIT: Assuming your uploading a large number of images (such as a photo album), and POSTing them to your PHP script, you could use javascript to read the results back from the post and update the progress bar based on the number of images uploaded / total number of images. This has the side effect of only updating after each post has completed. Check out here for some info on how to post with JS.

  12. nibuster dice:

    You would need to use Javascript to create a progress bar. A simple Google search led me to this article: WebAppers Simple Javascript Progress Bar with CSS.

    Dojo File Upload Progress Bar Widget is another option using the Dojo Javascript framework.

    EDIT: Assuming your uploading a large number of images (such as a photo album), and POSTing them to your PHP script, you could use javascript to read the results back from the post and update the progress bar based on the number of images uploaded / total number of images. This has the side effect of only updating after each post has completed. Check out here for some info on how to post with JS.

  13. Anonymous dice:

    Gears and HTML5 have a progress event in the HttpRequest object for submitting a file upload via AJAX.

    http://code.google.com/apis/gears/api_httprequest.html#HttpRequestUpload
    http://developer.mozilla.org/en/Using_files_from_web_applications

    Your other options as already answered by others are:

    1. Flash based uploader.
    2. Java based uploader.
    3. A second comet-style request to the web server or a script to report the size of data received. Some webservers like Lighttpd provide modules to do this in-process to save the overhead of calling an external script or process.

    Technically there is a forth option, similar to YouTube upload, with Gears or HTML5 you can use blobs to split a file into small chunks and individually upload each chunk. On completion of each chunk you can update the progress status.

  14. Anonymous dice:

    I just found Mega Upload (http://www.raditha.com/php/progress.php) which uses perl do the uploading and display a progress bar.

  15. Anonymous dice:

    Another uploader full JS : http://developers.sirika.com/mfu/

    • Its free ( BSD licence )
    • Internationalizable
    • cross browser compliant
    • you have the choice to install APC or not ( underterminate progress bar VS determinate progress bar )
    • Customizable look as it uses dojo template mechanism. You can add your class / Ids in the te templates according to your css

    have fun

  16. Anonymous dice:

    You would need to use Javascript to create a progress bar. A simple Google search led me to this article: WebAppers Simple Javascript Progress Bar with CSS.

    Dojo File Upload Progress Bar Widget is another option using the Dojo Javascript framework.

    EDIT: Assuming your uploading a large number of images (such as a photo album), and POSTing them to your PHP script, you could use javascript to read the results back from the post and update the progress bar based on the number of images uploaded / total number of images. This has the side effect of only updating after each post has completed. Check out here for some info on how to post with JS.

  17. Anonymous dice:

    Christian Stocker also made a PHP module to help analysing file uploads: http://blog.liip.ch/archive/2009/01/22/uploadprogress-0-9-2-released.html

Lascia un commento

Il tuo indirizzo email non verrà pubblicato. I campi obbligatori sono contrassegnati *

È possibile utilizzare questi HTML tag e attributi: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>