Jump to content

Upload Progress Bar


JustinMs66@hotmail.com

Recommended Posts

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

here is my index.php code:
[url=http://csscobalt.com/uploads/index.txt]http://csscobalt.com/uploads/index.txt[/url]

here is my current upload.php code:
[url=http://csscobalt.com/uploads/upload.txt]http://csscobalt.com/uploads/upload.txt[/url]

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:
[url=http://php5.bluga.net/UploadProgressMeter/demo.php]http://php5.bluga.net/UploadProgressMeter/demo.php[/url]

can anyone help me with this?
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

  • 3 months later...
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 [url=http://linardy.com/blog.php?post=8]http://linardy.com/blog.php?post=8[/url]

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 ;)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.