Page 1 of 1

file upload ... status bar?

Posted: Mon Aug 07, 2006 5:28 pm
by sroberts209
Hi There,

We are designers working on a simple website for a local Print Shop. They want a way for clients to upload files to their FTP site, right from the website.

The PHP Programmer we have hired has got it working, but he says there's no way to display a "status bar" showing that the file is actually uploading.

Is this true?

Without a status bar, the user sees nothing, and doesn't know his file is uploading, so he thinks there is an error, and clicks away.

help?

Posted: Mon Aug 07, 2006 5:30 pm
by Chris Corbyn
It's mostly true that it can't be done. We've tried before and failed.

That said, if you're willing to add an extension to PHP then it can be done. I don't remember exactly what the extension is though.

Posted: Mon Aug 07, 2006 5:31 pm
by Luke
flash could create a upload status bar... or you could create the illusion of a status bar by just displaying rotating arrows and "Uploading". I'm sure there are ways with javascript and/or ajax, but that depends on how much time you want to spend on this

Posted: Mon Aug 07, 2006 5:32 pm
by hawleyjr
I've seen this done using AJAX.

Basically you check the size of the temp file while uploading.

Doing a search in google for "ajax file upload" I found a few tuturials.

Posted: Mon Aug 07, 2006 5:37 pm
by sroberts209
Ninja Space Goat...

you mentioned Flash...

We've done some simple Flash "status bars" ... but is this somehting that could be made to work with the current php setup?

(I know nothing about php ... and we don't want to "un-do" all the work our programmer has already done)

Thanks!

Posted: Mon Aug 07, 2006 5:39 pm
by Luke
no, I don't think so. You'd have to rebuild the app in flash.

Posted: Mon Aug 07, 2006 5:42 pm
by Christopher
hawleyjr wrote:I've seen this done using AJAX.
I can be done with Ajax or meta-refresh.
hawleyjr wrote:Basically you check the size of the temp file while uploading.
Can't be done in PHP without patching PHP (there is a project out there that does that). The problem is that your script is not run until the files are uploaded. Most systems use a Perl script to track the file size.

Posted: Mon Aug 07, 2006 5:48 pm
by hawleyjr
arborint wrote:
hawleyjr wrote:I've seen this done using AJAX.
I can be done with Ajax or meta-refresh.
hawleyjr wrote:Basically you check the size of the temp file while uploading.
Can't be done in PHP without patching PHP (there is a project out there that does that). The problem is that your script is not run until the files are uploaded. Most systems use a Perl script to track the file size.
I pretty busy now and don't have time to go through this blog but doesn't this work?

http://blog.joshuaeichorn.com/archives/ ... -progress/

It says here that after PHP 4.3.7 the patch is no longer needed. Although, like I said. I didn't read the whole thing ;)


Demo:
http://php5.bluga.net/progressDemo/demo.php

Posted: Mon Aug 07, 2006 7:07 pm
by volka
php 5.2 supports upload hooks.
Until then you might try http://www.raditha.com/megaupload/