sanjay_zed Posted April 25, 2012 Share Posted April 25, 2012 hello guys, i need a help from u. from past 1 week , i am searching for it. may be it is simple query for you . in my project, i am uploading a file, for example 5mb of audio file, while uploading i need to display a progress bar along with percentage of how much it is uploaded to server ( as it works in google chrome browser). i tried several codes by searching in google . No code is working. i can able to display only loader.gif image not the status bar with percentage. so pls guys if you have these codes, pls share it . Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/ Share on other sites More sharing options...
litebearer Posted April 25, 2012 Share Posted April 25, 2012 You need some javascripting (client-side) rather than php (server-side) Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/#findComment-1340374 Share on other sites More sharing options...
Adam Posted April 25, 2012 Share Posted April 25, 2012 It's a combination of both. PHP allows you to track uploads, but you need sufficient permission on your server to be able to change a config directive (either with ini_set at run time or in the php.ini file). Essentially all you do is trigger the upload through a hidden iframe, and then fire off periodic AJAX requests with JavaScript to read the session state to get the current percentage. Have a read: http://www.php.net/manual/en/session.upload-progress.php Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/#findComment-1340383 Share on other sites More sharing options...
kicken Posted April 25, 2012 Share Posted April 25, 2012 Have a read: http://www.php.net/manual/en/session.upload-progress.php Note that to use the above feature you have to be using php 5.4 with both session.auto_start and session.upload_progress.enabled turned on in your php.ini. Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/#findComment-1340387 Share on other sites More sharing options...
Adam Posted April 25, 2012 Share Posted April 25, 2012 Is it PHP5.4? Ah sorry, I thought it was 5.3. Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/#findComment-1340390 Share on other sites More sharing options...
xyph Posted April 25, 2012 Share Posted April 25, 2012 Yeah, you need a PEAR package to do it before 5.4 Alternately, I really like Plupload http://www.plupload.com/ Link to comment https://forums.phpfreaks.com/topic/261572-problem-in-displaying-progress-bar-with-percentage-while-uploading/#findComment-1340446 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.