transferring an uploaded file to a cdn

13 views
Skip to first unread message

mattd

unread,
Dec 22, 2009, 4:54:49 PM12/22/09
to Tornado Web Server
hey,

i have the nginx module handing site uploads, but still need to
transfer files (3-5mb each, lets say) to our cdn, and would rather not
delegate that to a background job. whats the best way to do this
without blocking other requests? can i do this in an async callback?


thx,
matt

mattd

unread,
Dec 22, 2009, 5:14:25 PM12/22/09
to Tornado Web Server
the first sentence should say "i have the nginx upload module handling
site uploads,". thx.

Elias Torres

unread,
Dec 22, 2009, 9:09:16 PM12/22/09
to python-...@googlegroups.com
I implemented this using Python boto and Amazon's CDN. I handle uploads using Tornado keeping the upload in memory, then making an async call to put the file in an Amazon S3 bucket.

-Elias

mattd

unread,
Dec 22, 2009, 11:20:15 PM12/22/09
to Tornado Web Server
the nginx upload module writes the file to disk and then passes back a
set of arguments describing the upload (path, name, content type,
etc). if i were to use boto to upload the file from disk, would that
cause any problems?

Elias Torres

unread,
Dec 23, 2009, 7:59:25 AM12/23/09
to python-...@googlegroups.com
Nope. Boto can read from any file-like object, reader function or string.

-Elias

Reply all
Reply to author
Forward
0 new messages