# PHP - file loading bar

**URL:** <https://forum.kirupa.com/t/php-file-loading-bar/183599>\
**Category:** programming\
**Created:** [March 28, 2006, 6:24pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599 "2006-03-28T18:24:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![imagined](https://avatars.discourse-cdn.com/v4/letter/i/a87d85/32.png) [@imagined](https://forum.kirupa.com/u/imagined)\
**Post date:** [March 28, 2006, 6:24pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599/1 "2006-03-28T18:24:32Z")

</div>

I created this website for a client that users can open a power point presentation file but the files are like from 20 MB to 60 MB. it takes a looooooong time to load. people may even think the PC is frozen. how can i create a File Loading Progress Bar so users wont get that impatient?

I know I can use an animated GIF or like a Flash file. But how can I get how much of the power point presentation file has been downloaded? For programming I usually use PHP, but im kinda intermediate.

Thanks in advance,

Leo:huh:

---

<div class="post-metadata">

**Author:** ![grappaFruit](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@grappaFruit](https://forum.kirupa.com/u/grappaFruit)\
**Post date:** [March 31, 2006, 1:54pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599/2 "2006-03-31T13:54:07Z")

</div>

Nearly impossible - there are some dirty tricks, but i’ve never seen any of them work like it should.

The one I use is fairly simple (at least for recurring customers), and more importantly, doesn’t slow down the the download speed:  
Step 1: calculate the size of the file.  
Step 2: create a log (txt, mySQL, doesn’t matter) to store the averages (from any customer)  
Step 3: when a user finishes downloading, place the speed/time in a cookie.

Now you can easely calculate the time & speed. If the user doesn’t have any stored avarage, you can use the average from your log.

If you need any help with this, let me know.

---

<div class="post-metadata">

**Author:** ![bwh2](https://avatars.discourse-cdn.com/v4/letter/b/8c91f0/32.png) [@bwh2](https://forum.kirupa.com/u/bwh2)\
**Post date:** [March 31, 2006, 3:47pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599/3 "2006-03-31T15:47:08Z")

</div>

i don’t know for sure and i’m no AJAX expert, but you might be able to find one using AJAX and PHP. [http://www.google.com/search?q=ajax+upload+progress](http://www.google.com/search?q=ajax+upload+progress)

---

<div class="post-metadata">

**Author:** ![Seb\_Hughes](https://avatars.discourse-cdn.com/v4/letter/s/839c29/32.png) [@Seb\_Hughes](https://forum.kirupa.com/u/Seb_Hughes)\
**Post date:** [March 31, 2006, 4:14pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599/4 "2006-03-31T16:14:55Z")

</div>

Cant do it, Like when you start your windows, it only has the bar going it doesnt show progress. As far as i know cant do it.

---

<div class="post-metadata">

**Author:** ![grappaFruit](https://avatars.discourse-cdn.com/v4/letter/g/43a26b/32.png) [@grappaFruit](https://forum.kirupa.com/u/grappaFruit)\
**Post date:** [March 31, 2006, 4:39pm UTC](https://forum.kirupa.com/t/php-file-loading-bar/183599/5 "2006-03-31T16:39:12Z")

</div>

Ajax methods are only usefull if you’re planning to use the whole package extensivly - otherwise it consumes too much recources (bw, cpu, …)

Good luck anyways!
