Upload Progress Bar in PHP

前端 未结 10 1499
栀梦
栀梦 2020-11-22 17:33

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

10条回答
  •  天涯浪人
    2020-11-22 17:41

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

    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.

提交回复
热议问题