paste.progress to monitor file uploads?

159 views
Skip to first unread message

He Shiming

unread,
Jan 15, 2011, 8:20:45 AM1/15/11
to pylons-discuss
Dear Pylons Community,

I'm working on the part of a project that involves monitoring a queue
of multiple file uploads for a session. The objective is to create an
ajax progress bar similar to those file hosting services.

I searched on this topic and found that I'll need to configure some
middleware component with paste.progress to implement it. But I can't
seem to find any example on this subject.

Could anyone guide me through the making of this kind of
functionality? Thanks in advance!

Best regards,
He Shiming

Juliusz Gonera

unread,
Jan 15, 2011, 12:14:50 PM1/15/11
to pylons-...@googlegroups.com

If you plan to use Paster in production, you can use gp.fileupload:
http://pypi.python.org/pypi/gp.fileupload/
If e.g. you plan to use uWSGI, Nginx and Cherokee have modules for
handling this, e.g. http://wiki.nginx.org/HttpUploadProgressModule

--
Juliusz Gonera
http://juliuszgonera.com/

He Shiming

unread,
Jan 15, 2011, 8:59:54 PM1/15/11
to pylons-discuss
On Jan 16, 1:14 am, Juliusz Gonera <jgon...@gmail.com> wrote:
>
> If you plan to use Paster in production, you can use gp.fileupload:http://pypi.python.org/pypi/gp.fileupload/
> If e.g. you plan to use uWSGI, Nginx and Cherokee have modules for
> handling this, e.g.http://wiki.nginx.org/HttpUploadProgressModule
>
> --
> Juliusz Gonerahttp://juliuszgonera.com/

Thanks. I did try gp.fileupload. But the demo http://www.gawel.org/docs/gp.fileupload/demo.html
didn't work on my chrome and firefox browsers. I'm not seeing any
progress at all.

On the other hand, I'm not aware of the difference between paster and
nginx's module. I'm currently developing my application under paster.
Does that mean I can't run my app in nginx? If I use the nginx module,
does that mean I have to continue development in nginx only?

Best regards,
He Shiming

Gael Pasgrimaud

unread,
Jan 15, 2011, 9:45:53 PM1/15/11
to pylons-...@googlegroups.com
Hi,

On Sun, Jan 16, 2011 at 2:59 AM, He Shiming <hesh...@gmail.com> wrote:
> On Jan 16, 1:14 am, Juliusz Gonera <jgon...@gmail.com> wrote:
>>
>> If you plan to use Paster in production, you can use gp.fileupload:http://pypi.python.org/pypi/gp.fileupload/
>> If e.g. you plan to use uWSGI, Nginx and Cherokee have modules for
>> handling this, e.g.http://wiki.nginx.org/HttpUploadProgressModule
>>
>> --
>> Juliusz Gonerahttp://juliuszgonera.com/
>
> Thanks. I did try gp.fileupload. But the demo http://www.gawel.org/docs/gp.fileupload/demo.html
> didn't work on my chrome and firefox browsers. I'm not seeing any
> progress at all.
>

Yeah look like my demo is broken... But the interesting stuff (which
is not the javascript part..) should work.
You need this middleware: http://www.gawel.org/docs/gp.fileupload/upload.html


> On the other hand, I'm not aware of the difference between paster and
> nginx's module. I'm currently developing my application under paster.
> Does that mean I can't run my app in nginx? If I use the nginx module,
> does that mean I have to continue development in nginx only?
>

Of course. And I strongly encourage this way. gp.fileupload replace
the wsgi.input and this is not recommended. (it work though.. :)

You can use nginx to act as a reverse proxy (if the module support a
proxy ?) and use the upload module for some specific paths.
Like Juliusz said you can also use uWSGI (paster is also a WSGI server)

I do not known about this module but It's probably a cleverer solution
than gp.fileupload since it's embed in a robust web server.

The problem is that you need the whole environment to develop and test
your application.
Having all the stuff in a python process is simpler but it's also less
efficient in production IMHO.

--
Gael

> Best regards,
> He Shiming
>
> --
> You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
> To post to this group, send email to pylons-...@googlegroups.com.
> To unsubscribe from this group, send email to pylons-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
>
>

Juliusz Gonera

unread,
Jan 16, 2011, 7:03:32 AM1/16/11
to pylons-...@googlegroups.com
Gael Pasgrimaud wrote:

> The problem is that you need the whole environment to develop and test
> your application.
> Having all the stuff in a python process is simpler but it's also less
> efficient in production IMHO.

What I currently do is to use both - gp.fileupload for development and
Nginx module in production. The interface is a bit different though so I
had to write my own JS. It first tries to query Nginx module and if it
gets 404 (which means that Paster is used) it sends a request to
gp.fileupload. You can have a look at it:
https://gist.github.com/781722
${c.upload_id} is a random ID generated in Pylons.

He Shiming

unread,
Jan 16, 2011, 7:21:55 AM1/16/11
to pylons-discuss
Thank you all. It looks like I'll put some time on both gp.fileupload
and the nginx module.

Best regards,
He Shiming

Gael Pasgrimaud

unread,
Jan 25, 2011, 9:47:51 AM1/25/11
to pylons-...@googlegroups.com
Look like the new jQuery HTML5 file upload rock:
http://aquantum-demo.appspot.com/file-upload

Reply all
Reply to author
Forward
0 new messages