News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Tracking Upload Progress with PHP and JavaScript
February 06, 2012 @ 13:58:32

In a new tutorial today from PHPMaster.com, they show you how to combine Javascript and a PHP feature to track the progress of an upload to your web application.

A problem that has plagued web developers for years is how to add real-time information to their applications, such as a progress bar for file uploads. [...] JavaScript can access a file's name, type, and even the width and height of a local image, but it wasn't until HTML5 that it could access a file's size. [...] In this article I'll show you how [the session.upload_progress] feature can be used to create a simple upload progress bar without any external libraries or browser dependencies.

The tutorial provides all the steps you'll need to get it working - defining the form with the extra required field, styling it and plugging the Javascript in to call a small script to get the progress of the upload. It returns the difference between the content-length of the file and the current size (as a percentage of 100).

0 comments voice your opinion now!
track upload progress extension javascript tutorial progressbar


Dave Marshall' Blog:
Asynchronous cache priming with progress bars via Gearman, Memcache and Dojo
April 04, 2011 @ 10:18:20

Dave Marshall has written up a new post showing how he's used memcache, Gearman and Dojo to create an asynchronous progress bar he uses when generating large reports.

I have a (highly optimised) report that takes way too long to generate, up to around 30 seconds. [There's] too many variables to prime caches for every possible combination [and] personally, I don't think the browsers inbuilt progress bar is enough feedback for todays web users.

He generates the data into memcache when the user requests it and uses the Gearman worker processes to handle requests for data that doesn't yet exist. The progress bar is a part of Dojo and uses the dijit.ProgressBar widget to keep checking the progress of the build. This way the user can even leave the page and come back if the process takes too long with no threat to the generating report. You can find all of his code he's used to make it happen on his github account.

0 comments voice your opinion now!
gearman tutorial memcache dojo progressbar generate report


Brian Moon's Blog:
PHP command line progress bar
March 11, 2010 @ 10:23:41

Brian Moon has a quick post that links to a but of code that gives you a progress bar for the command line that's flexible enough to be used in an number of situations.

Was just looking through some code and came across this function I wrote some time ago. If you do a lot of your processing scripts in PHP like we do, you probably need to know what is going on sometimes. So, I made a progress bar for use on the cli. I thought I would share it.

You can see a demo of it here (screencast) or just download the code. Comments on the post also point out the PEAR Console_Progressbar package and the ez Components class for creating a more advanced progress bar.

0 comments voice your opinion now!
progressbar commandline cli screencast



Community Events





Don't see your event here?
Let us know!


podcast language introduction interview install community list package framework api release symfony update opinion series deployment laravel library tips zendserver

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework