JustinMs66@hotmail.com Posted September 12, 2006 Share Posted September 12, 2006 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? Quote Link to comment Share on other sites More sharing options...
shocker-z Posted September 12, 2006 Share Posted September 12, 2006 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 phpRegardsLiam Quote Link to comment Share on other sites More sharing options...
JustinMs66@hotmail.com Posted September 12, 2006 Author Share Posted September 12, 2006 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. Quote Link to comment Share on other sites More sharing options...
gijew Posted September 12, 2006 Share Posted September 12, 2006 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. Quote Link to comment Share on other sites More sharing options...
mlin Posted December 17, 2006 Share Posted December 17, 2006 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 patchor 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 ;) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.