Jump to content


Photo

Upload - Progress


  • Please log in to reply
9 replies to this topic

#1 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 02 October 2006 - 12:45 AM

I'm wondering, how do you go about making a progress bar when using an upload form

Basically so a user can see the percentage uploaded of their file...
I would love to change the world, but they won't give me the source code

SEO Agency

#2 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 02 October 2006 - 12:56 AM

You need Perl or you need to hack the source / core, explicitly altering how rfc1867.h works, which I wouldn't recommend if you don't know C or C++ and PHP(s) core structure. There is a hack to do this, but it has memory leaks. If you check the PHP mailing list around June of 2003, Wez Furlong (PHP Team) and someone else posted a better way of doing it (supporting RAW_POST_DATA) for upload input streams!


me!

#3 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 02 October 2006 - 12:58 AM

Surely their is another way !

Hmm..
I would love to change the world, but they won't give me the source code

SEO Agency

#4 marknt

marknt
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts
  • LocationPhilippines

Posted 02 October 2006 - 01:18 AM

You need Perl or you need to hack the source / core, explicitly altering how rfc1867.h works, which I wouldn't recommend if you don't know C or C++ and PHP(s) core structure. There is a hack to do this, but it has memory leaks. If you check the PHP mailing list around June of 2003, Wez Furlong (PHP Team) and someone else posted a better way of doing it (supporting RAW_POST_DATA) for upload input streams!


me!

That is correct. Im trying to search an alternative way than using Perl to implement the upload progress bar but as of now i found nothing. I'll keep on googling  :)

#5 Destruction

Destruction
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 02 October 2006 - 02:04 AM

I believe there may be a way to do this though I'm not 100% sure.  I was considering something similar a while ago.  The way I thought of doing it was to use JavaScript/AJAX/PHP.  JavaScript could find the total filesize, though the only way I found so far is tricky with security permissions and unsigned ActiveX (see here: http://www.jguru.com....jsp?EID=330134).  AJAX would call a php script which would check the current filesize of the file as it's being uploaded to the server.  This is where I was a little stuck personally as I don't think you can use $_FILES until after the file is uploaded.  Hopefully you'll be able to find out a little more from here as I put my own research on hold some time ago.

HTH

Dest

#6 jaymc

jaymc
  • Members
  • PipPipPip
  • Advanced Member
  • 1,521 posts
  • LocationLiverpool

Posted 02 October 2006 - 12:32 PM

I believe there may be a way to do this though I'm not 100% sure.  I was considering something similar a while ago.  The way I thought of doing it was to use JavaScript/AJAX/PHP.  JavaScript could find the total filesize, though the only way I found so far is tricky with security permissions and unsigned ActiveX (see here: http://www.jguru.com....jsp?EID=330134).  AJAX would call a php script which would check the current filesize of the file as it's being uploaded to the server.  This is where I was a little stuck personally as I don't think you can use $_FILES until after the file is uploaded.  Hopefully you'll be able to find out a little more from here as I put my own research on hold some time ago.

HTH

Dest


Yeh thats exactly how I thought it could be done

for that to work though, you would need to know the file name the the php ["tmp"] dir and just java ajax refresh every 5 seconds and compare the uploaded so far file size to the actually file size

Its just how to do that though..
I would love to change the world, but they won't give me the source code

SEO Agency

#7 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 02 October 2006 - 02:26 PM

Here is a freebie that you might want to check out: http://seemysites.ne...older/uploader/

#8 karthikeyan_coder

karthikeyan_coder
  • Members
  • PipPipPip
  • Advanced Member
  • 201 posts

Posted 02 October 2006 - 02:36 PM

going to check alpine's sol
www.karthi.us

#9 printf

printf
  • Staff Alumni
  • Advanced Member
  • 889 posts

Posted 02 October 2006 - 02:50 PM

You still need Perl, for that version, because it needs to pass the file(s) name to PHP, because PHP can not get at the RAW_POST_DATA, so you will be using (2) connections, (1) to upload, (1) to monitor, that keeps looping, so 10MB file, uploaded at 30Kbytes per second will send 900 requests to the server if the interval is 1.5 seconds. Lower connection speed(s) results in more looping requests!

Not very smart, if you ask me!

me!

#10 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 02 October 2006 - 03:20 PM

I can do it but as a fake upload counter not a reel situation but the user dont know that ha.

what i do is when a user submits the image i point the form to a update.php and then from update.php i redirect them to a page where i got a animated gif going from side to side then afther 40 sec i send them to a confirmation page with thank you but if there is a error they goto the upload page agin with a error comment.

all i use is a animated image and php location syntex.

Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users