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
Supper Baby
Forum Commoner
Posts: 27 Joined: Tue Aug 01, 2006 11:33 pm
Post
by Supper Baby » Sat Aug 19, 2006 7:20 pm
Hello every one,
Can I make UPLOAD Bar Show the upload or Download process ?
I'll use PHP & JavaScript ( Ajax ) but I can't find any way to do it.
I think it can be done via Java not sure about JS
Is there any one have idea about it or if he knows if I can do it using JS or not ?
Jenk
DevNet Master
Posts: 3587 Joined: Mon Sep 19, 2005 6:24 am
Location: London
Post
by Jenk » Sat Aug 19, 2006 10:46 pm
It is possible, but is not 'easy' and is long-winded for what is essentially.. not worth it.
XMLHttpRequest and a seperate PHP request from the one that you wish to check the progress off can do it.
Supper Baby
Forum Commoner
Posts: 27 Joined: Tue Aug 01, 2006 11:33 pm
Post
by Supper Baby » Sun Aug 20, 2006 1:11 am
I can't imagine it.
How can I handle the Download process via PHP or Ajax ??
I've movie or picture or any file which visitor will download it. I can't separate the file.
how can I seperate PHP request ?? if I have one file ?
Shendemiar
Forum Contributor
Posts: 404 Joined: Thu Jan 08, 2004 8:28 am
Post
by Shendemiar » Sun Aug 20, 2006 5:26 am
You can Fake, and add animated gif to your page, that is revealed by javascrip when the form is submitted.
Luke
The Ninja Space Mod
Posts: 6424 Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA
Post
by Luke » Sun Aug 20, 2006 11:30 am
I just use an animation that says uploading... with some sort of "loading" type animation that just repeats until it's finished.
Supper Baby
Forum Commoner
Posts: 27 Joined: Tue Aug 01, 2006 11:33 pm
Post
by Supper Baby » Sun Aug 20, 2006 12:07 pm
Thank you for you help.
I looking for realy download bar show the upload process the time left, download speed, downloaded size and size left.
I need it like OS and DAP.
nickvd
DevNet Resident
Posts: 1027 Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:
Post
by nickvd » Sun Aug 20, 2006 1:58 pm
Php can not do this, at least not without an extention to be installed. Almost any time you see a php site use an upload progress bar, it's a perl script in the background that's processing the upload. Php doesn't receive the uploaded file's details (size, filename, etc) until the whole file is uploaded, whereas perl receives the file as it's being uploaded and can there fore check how much is left in the upload.
Give Uber-Uploader a try, I haven't had a chance to check it out yet, but it's widely used:
http://uber-uploader.sourceforge.net/
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Sun Aug 20, 2006 2:04 pm
side note: php 5.2 will provide upload hooks.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sun Aug 20, 2006 2:53 pm
volka wrote: side note: php 5.2 will provide upload hooks.
Unless I've missed the discussion, I think it's only provided to the internals. So an extension could provide information, but inside of PHP, I don't think it's available.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Mon Aug 21, 2006 9:20 am
Uh, I think you're right.
pitty
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Mon Aug 21, 2006 9:27 am
volka wrote: Uh, I think you're right.
pitty
Indeed, an extreme disappointment.