Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

python ajax progress bar

Name: Anonymous 2009-09-12 19:04

Hi /prog/,

I'm making a progress bar for a file upload, for a website. I was going to have two python scripts- The first gets submitted a file, logs the total, and then starts writing it to disk. The second script is called on by the javascript (ajax) to return how much has been written to disk so far and the total.

The problem is how do I get the second script aware of the total each time? I could use SQL but I feel like that's too much. I also looked at solutions like Tokyo Cabinet and memcached, but still I feel like there must be a more elegant simple solution.

Thoughts?

Name: Anonymous 2009-09-12 19:11

Have you read your SICP today?

Name: Anonymous 2009-09-12 19:12

You could not use two scripts.

Name: Anonymous 2009-09-12 19:19

>>3

How would the first script write back? That's retarded.

Name: Anonymous 2009-09-13 0:02

>>4

Why would it need to?

Name: Anonymous 2009-09-13 0:47

now, what you want to do is perform a kernel hook into their IP stack.
you monitor the length of the payload for every packet destined to your webserver and keep a running total. compare this to the total file size and pump it into the status bar.
i'm not sure if it's possible yet, but i hear that x86Javascript is just on the horizon, so be patient.

Name: Anonymous 2009-09-13 2:38

Here, have a cookie.

Name: Anonymous 2009-09-13 11:58

I think even Gmail's upload progress bar only works under flash...if you use their older AJAX upload method, you get no progress bar.  It's worth considering that this may because they didn't want to have to shoehorn in an awful hack like you're planning to do.

If this is for a school project or something, you're stuck I guess, but if there's choice, I wouldn't do it.  Very low return for a complex task.

Name: Anonymous 2009-09-14 18:45

OP, report back.  Or apologize.

Name: Anonymous 2009-09-14 18:52

Maybe you should leverage folksonomies with technologies built upon social APIs that allow agile deployment on cloudsourced virtual stacks instead.

Name: Anonymous 2011-02-03 0:49

Name: Anonymous 2011-02-03 1:29


Don't change these.
Name: Email:
Entire Thread Thread List