Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-30-2009, 12:26 AM   PM User | #1
nomanic
Regular Coder

 
nomanic's Avatar
 
Join Date: Feb 2009
Location: United Kingdom
Posts: 252
Thanks: 9
Thanked 33 Times in 33 Posts
nomanic is an unknown quantity at this point
File Upload with Progress Bar php/javascript

does anyone know a good file upload with progress bar, I've tried and tried to implement one with no luck at all, just cant seem to get it to work

any advice would be most helpful, many thanks
nomanic is offline   Reply With Quote
Old 03-30-2009, 03:09 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,244
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Would appreciate it if you wouldn't send private messages to many people until you've waited a reasonable time for an answer in the forums. No, 2 hours is not a "reasonable time". Depending on how active the forum is, maybe 12 hours to 2 days.

Anyway, same answer I gave you privately:

****************

I can't see why it would be that hard, depending on what backend technology you are using.

You'd need to be using a backend such as ASP or JSP that allows "session state". You would make *TWO* AJAX requests on the server. First, you'd initiate the data request. Then you'd make a request for the progress percentage. Two different "pages" that share the same session. The one fetching the data would need to store its progress in a session variable. The one getting the progress value would simply read that session variable and return the number to its caller. That caller would update the display and then (perhaps after waiting 1 to 5 seconds, depending on the expected data fetch time?) ask again for the progress.

If the two "pages" can't share session info, then they could share the info via a simple database table. The client could pass a guid, say, to both of them and the data grabber would store a record with that guid as the key value and the percentage progress as the data. Really the same thing as sharing the session, just done ad hoc instead of via the builtin mechanisms.
*******************

Never done this, but can't see that it would be that hard.
Old Pedant is offline   Reply With Quote
Old 03-30-2009, 09:32 AM   PM User | #3
nomanic
Regular Coder

 
nomanic's Avatar
 
Join Date: Feb 2009
Location: United Kingdom
Posts: 252
Thanks: 9
Thanked 33 Times in 33 Posts
nomanic is an unknown quantity at this point
Thankyu so much for your help Old Pedant, but it simply doesn't mean anything to me
I wouldn't know how to code such a thing
when I follow a tutorial it works on their site but not locally on mine once I've followed their instructions, I'm just trying it without knowing what I'm doing at all with this
anyone feel like leading me by the hand? or know a good tutorial?
sorry to ask
nomanic is offline   Reply With Quote
Old 03-30-2009, 09:51 PM   PM User | #4
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,244
Thanks: 59
Thanked 3,998 Times in 3,967 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
Ahh, see, that's an entirely different question!

You said "I've tried and tried to implement one with no luck..." So I assumed you meant that YOU were doing the coding!

What you seem to be looking for, really, is a precanned solution, no?

And no, that I don't have. I do know that a company named Persits has done almost exactly what I described for the last 6 to 8 years, long before AJAX came into being. They do it using an <IFRAME>. They use a META REFRESH in the <IFRAME> to keep loading in a new progress image. But, as I said, it only works because both the page displayed in the <IFRAME> and the page that is doing the work (in their case, it's for a file upload control) are able to share "session" information. It happens to be written in ASP code, but I know the same concept would work fine with JSP. I don't use PHP, so I dunno if PHP supports "session variables" in the same way, but if it does then you could use the same technique.

I really do think that an experienced PHP and JavaScript developer could throw this together in a couple of hours (again, assuming that PHP supports session varaibles the same way...add a few more hours if the session trick wouldn't work), but with no experience in PHP, that person isn't me. I could do it in ASP or JSP, though. Maybe not the prettiest version, but it would work, I think.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:40 PM.


Advertisement
Log in to turn off these ads.