file upload ... status bar?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sroberts209
Forum Newbie
Posts: 2
Joined: Mon Aug 07, 2006 5:21 pm

file upload ... status bar?

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post 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
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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.
sroberts209
Forum Newbie
Posts: 2
Joined: Mon Aug 07, 2006 5:21 pm

Post 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!
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

no, I don't think so. You'd have to rebuild the app in flash.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Post 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.
(#10850)
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

php 5.2 supports upload hooks.
Until then you might try http://www.raditha.com/megaupload/
Post Reply