Jump to content

PHP Progress bar


eli312

Recommended Posts

Hey all,

 

Not sure if this is in the correct place (sorry if it is not)

 

But i have been looking for hours now for a simple progress bar system when uploading bigger files.

Im not even looking for good looking loading bar a simple percent would be good for me.

 

But every site i have looked at to get any help or ideas from the comments are "Does not work", "Error" and that sort of thing.

I have even tried many myself and can not get them to work. (at least 5-6)

 

Some even requires the you to install add on programs to your sever - this i can not do as i don't own it.

 

There must be a easy way to solve this problem?

 

Please help

 

Thank you.

 

Eli

 

 

Link to comment
https://forums.phpfreaks.com/topic/215078-php-progress-bar/
Share on other sites

The problem occurs because it is the web server that handles the upload and only invokes the target page of the form action = "" attribute once the upload has completed.

 

Even the Alternative PHP Cache (APC) upload progress is limited to a single thread because they did not build in a way of passing a unique process id back and forth between the pieces of code.

 

I have seen a php script that listens on a specifically assigned port number and handles the uploading of the file directly and passes a process id to the code running in the browser. If I find the script, I will post a link.

 

Edit: http://sourceforge.net/projects/upu

Link to comment
https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118688
Share on other sites

Thanks guys for the help.

In the end i decided to go a different way (as making a progress bar was complex)

 

I simple used a little javascript/jquery not to do anything more fancy then hide the uploading functions and replace with loading please wait and an animated gif.

 

<form action="upload.php" name="upload_music" enctype="multipart/form-data" method="POST" onsubmit="checkUpload();">

 

Using the onsubmit to call checkUpload function

function checkUpload() {
$("#Music").fadeOut();
$("#upload").fadeOut();
$("#upload_box").fadeOut();
$("#upload_boxAlert").fadeIn();
}

 

Which as i said hides the uploading and replaces it with:

<div id="upload_boxAlert">File uploading please wait...<br/><br/><img src="<?php echo IMG_LINK; ?>/mucLoader.gif"><br/><h2>(this could take up to 30 minutes)</h2></div>

 

I probably end up making a a real javascript progress bar.

 

But thanks for the ideas and help guys!

 

Eli

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1119066
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.