eli312 Posted October 3, 2010 Share Posted October 3, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/ Share on other sites More sharing options...
PFMaBiSmAd Posted October 3, 2010 Share Posted October 3, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118688 Share on other sites More sharing options...
rwwd Posted October 3, 2010 Share Posted October 3, 2010 have you looked at using jquery/ajax, uploadify This has some quite nifty features, and I think a progress bar is one of them, though you would need to read the blurb first.. Rw Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118690 Share on other sites More sharing options...
eli312 Posted October 4, 2010 Author Share Posted October 4, 2010 I will have to try these out when i get home. But is there not a function to like getbytes sent? so you could compare the file size with how much has been sent to create a simple persentage. Then use AJAX to update it. Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118877 Share on other sites More sharing options...
BlueSkyIS Posted October 4, 2010 Share Posted October 4, 2010 apparently perl does a better job of getting transferred file size. the more-accurate progress bars utilize perl on the server, though PHP can be used to call the perl. Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118896 Share on other sites More sharing options...
JonnoTheDev Posted October 4, 2010 Share Posted October 4, 2010 apparently perl does a better job of getting transferred file size. the more-accurate progress bars utilize perl on the server, though PHP can be used to call the perl. http://uber-uploader.sourceforge.net/ Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118911 Share on other sites More sharing options...
BlueSkyIS Posted October 4, 2010 Share Posted October 4, 2010 yep. "Uber-Uploader is a group of programs written in Perl, PHP and Javascript." Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1118913 Share on other sites More sharing options...
eli312 Posted October 4, 2010 Author Share Posted October 4, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/215078-php-progress-bar/#findComment-1119066 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.