Jump to content


Photo

Upload Progress Bar


  • Please log in to reply
4 replies to this topic

#1 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 12 September 2006 - 07:50 PM

i have a working upload script, and i want to add a Progress Bar.

here is my index.php code:
http://csscobalt.com/uploads/index.txt

here is my current upload.php code:
http://csscobalt.com...oads/upload.txt

and i want it to be in the index.php. like once you press "Upload", a bar will appear (or it can just already be there, it dosn't have to appear) and then it will show the upload progress.

here is an example of what i want:
http://php5.bluga.ne...sMeter/demo.php

can anyone help me with this?

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 12 September 2006 - 08:20 PM

well download the code for that project and play.. no one can do better than that..
~~If you need support then you'll be needing www.ajaxfreaks.com forums as nearly everything is javascript/AJAX not php


Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 JustinMs66@hotmail.com

JustinMs66@hotmail.com
  • Members
  • PipPipPip
  • Advanced Member
  • 138 posts

Posted 12 September 2006 - 08:32 PM

wul thats the thing, i'm only good at PHP, so thats why i wana make one that is in PHP, not AJAX.

so how would i go about doing this?

i was thinking maybe i could test the person who is uploading's internet speed, and then see how big the file is, and then calculate how long it would take, and just set the bar as an animation. a set speed. ...it wouldn't be exact, but it would be ok with me.

#4 gijew

gijew
  • Members
  • PipPipPip
  • Advanced Member
  • 240 posts
  • LocationCalifornia

Posted 12 September 2006 - 09:32 PM

Well you CANT do client side coding in PHP.  PHP is all server side so it would have to be AJAX or Javascript that would control the progress bar.
I'm considered good looking in some countries

#5 mlin

mlin
  • Members
  • PipPipPip
  • Advanced Member
  • 91 posts

Posted 17 December 2006 - 02:54 AM

The ajax isn't the hard part. Joshua Eichorn's example (the one you linked) uses his HTML_AJAX pear package and all the js is right there for you. No need to touch it at all, just handle your file once $_POST or $_FILES gets set as normal.

Same goes for Rasmus' example using yui library (looks pretty but doesn't work in ie6, so buyer beware)

The tough part is that you'll have to:
run php 5.2 with APC (alternative php cache)
patch your php installation with pdoru's patch
or use a perl script =(

The best option to me looked like running php 5.2 w/ APC which I'm currently on now. But I'm having trouble connecting to the hooks still. You can check out how I tried to get it running at http://linardy.com/blog.php?post=8

And, don't be scared of ajax, just head over to ajaxfreaks.com when you've got some time to kill, and you'll be asynchronously calling your php scripts in no time at all. Probably learn a few dom tricks too ;)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users