I'm sure you were just being quick, but zip files are binary, so
you'd probably want to do open('test.zip', 'rb') ... and readline
is not a good idea for binary. read() would be more appropriate

On Jan 29, 2009, at 1:59 PM, João Henriques (Madeira!) wrote:

> I guess it would something like:
>
> class serveZip:
>     def GET(self,):
>     web.header('Content-Type', 'application/zip')
>     a = open('test.zip','r')
>     for line in a.readlines():
>        print line
>     a.close()
>
> Change the content-type to whatever you need.
>
> 2009/1/29 Cowmix <[email protected]>
>
> Are there any examples on how to code a file download? Basically I
> want to have someone click on a link and have it prompt them to save
> whatever file to their harddrive.
>
> thanks!
>
>
>
> >

--
http://www.apgwoz.com





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/webpy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to