Upload Status Bar Upload Status Bar
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Upload Status Bar

Started by Zeitgeist, April 19, 2006, 09:57:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Zeitgeist

When uploading photos the conventional way, through the web interface, there's no information on the progress of how the photos are being uploaded -- how far done you are, if you timed out, etc... I think this would be a beneficial feature because a lot of the time people have no idea its doing anything, especially computer "newbies."

I've had plenty of friends get discouraged when uploading to my website (and then just going and putting them on facebook, webshots, etc) because they have no idea what's going on. Again, I think this would be beneficial, helpful, and welcomed.
I love GauGau!

Joachim Müller

that's just impossible - has been requested before. Using the http upload mechanisms of your browser means that you can't have a progress bar.

Zeitgeist

Uh. Why exactly did you delete my post showing you an example? It wasn't meant as an advertisement for software I don't even use, or have.
I love GauGau!

Joachim Müller

I haven't deleted a posting of yours as far as I can tell.

Zeitgeist

Oh. Maybe it was my post that was edited or it just didn't post.

Did you see the example I posted? It was an additional mod for a phpBB photo album that had the ability. It used perl and displayed a progress bar on the status of the upload.

Anyway, places like WebShots have a pop-up that is displayed when photos are being uploaded, ie "your photo is being uploaded" and then disappears when the uploading is complete.

I love GauGau!

Paver

#5
Since someone else just asked about this in another thread and was pointed here, I just read this thread for the first time and thought I'd read a little about this.

This page has a pseudo-PHP progress bar, but it requires Perl to be installed on your server as well.  The page describes why, how it's done, and a demo: http://www.raditha.com/php/progress.php.

Needless to say, Coppermine won't be adding it to the core.  It does sound like a good plugin project though, with of course clear documentation saying you need Perl on your server to use it.

Oh, and here is another link with more info & links regarding such a progress bar: http://blog.joshuaeichorn.com/archives/2005/05/01/ajax-file-upload-progress/

sharif_aly

I think could be made with AJAX

Joachim Müller

I don't think so. Ajax is yet another buzzword - it has been around all the time under other disguises. In fact it is JavaScript and CSS to change certain parts of a page (instead of loading the full page) based on information retrieved from the server, and this is why you can't use it: the server won't "tell" you about the progress of a file upload (at least not using methods that are available using PHP), so there will be no info the client can retrieve from the server and display accordingly. We understand how JavaScript works, we need a method to figure out what the server does (or rather: what the status of the communication between browser and server is).
Imo this could be circumvented by an ActiveX-Control for M$-Browsers, but then we'd be losing platform independence, and I doubt that there are dev team members who are willing to look into proprietary M$-stuff.

Abbas Ali

I had already developed a mod which uses MegaUpload (the link Paver referred to) on my local setup. It was working fine locally. But when i tried to upload it to live server...it didn't worked. I tried for few times and then gave up.

Maybe if i get time i will try once more to get it working on live server and post the mod here. But it uses PERL and not all will be benifitted. And also i won't be able to give support as i don't know perl.
Chief Geek at Ranium Systems

Abbas Ali

Here is the progress bar mod. Note that this is meant for only experienced users who know how web servers work. This mod is just an example to show that progress bar can be implemented. However 90% chances are that this mod won't work for you. In that case i won't be able to help since i myself don't know any perl. So please use this mod only if you know your way around. Normal users are NOT encouraged to use it.

Attached is the zip file. Keep megauploads folder in your server's cgi-bin directory. Replace upload.php and place pgbar.php in cpg root. Do take backups.

You will need to modify 3 things.

Edit upload.php and replace


$upload_cgi_path = '/cgi-bin/megauploads/upload.cgi';


with correct path as per your server.

Edit pgbar.php and replace


$link="/cgi-bin/megauploads/progress.cgi?iTotal=".$iTotal."&iRead=".$iRead."&iStatus=".$iStatus."&sessionid=".$sessionId."&dtnow=".$dtnow."&dtstart=".$dtstart;


with the correct path to the cgi directory on your server.

then edit megauploads/header.cgi and replace


$php_uploader="http://www.xyz.net/photos/upload.php";


with correct url to your upload.php script


Abbas
Chief Geek at Ranium Systems

Paver

Abbas: I'll look into it during the next week.  I know Perl pretty well, but I haven't looked at the Perl source yet to see if it seems familiar or not.

As for the Ajax solution, it may seem like an all-PHP solution, but I'm pretty sure it uses a modded PHP installation.  One of the first links it refers to is based on a patch to the PHP source that you compile then install.  Looking at the Ajax source, it looks like it refers to this "patched" PHP installation.

trippinsweet

Paver, did you look into it?

I've been independently searching for a method to integrate a progress bar into coppermine and the megaupload tool seemed like the best best for it.

If you've checked it out and encountered any issues, I'd like to know.

--

Oh and on another note, I wouldn't recommend the Ajax solution. It requires a modified PHP install and one of the very first replies to the blogpost announcing it claims that it was submitted to PHP but found not to be threadsafe... imo handling threads correctly is far more important than a enabling progress bar via php.

Paver

I have to stop giving time frames in my posts.  No, I haven't looked at it yet.  I don't mind the reminder - it's helpful so I know what I've forgotten to do.  I'll see what I can do.

Stramm

I have to dig that one out...

While browsing php.net I came across the 5.2 news and withing here I've read
Quote- Added RFC1867 fileupload processing hook.

( http://cvs.php.net/viewcvs.cgi/php-src/NEWS?view=markup&pathrev=PHP_5_2 )

So it's probably soon possible to code such an upload progress bar as a plugin or mod without all the above mentioned downsides

Joachim Müller

Yes, I've read that announcement as well (has even made it into popular German pc magazine "c't"). Drawback: it will take a while untill PHP5.2 will become popular. When coding it into coppermine's core code, minimum requirements would have to be raised to PHP5.2 as a consequence. It will take years untill this will happen.  Workaround: code this as a plugin/mod for those who already have PHP5.2 or better.

sharif_aly

I hope this can be done in plugins to make upload progress bar >> loading <<

Joachim Müller