Re: downloading a zip file attachment

Rainer Joswig <[email protected]> Wed, 17 Jul 2013 11:27:40 +0200
Newsgroups gmane.lisp.cl-http
Message-ID <[email protected]>
Hi Mark,

you can export ZIP files like this - given that you have a zip file on disk:

(http:define-url-export-type :zip-file :zip (:application :zip) :copy-mode :binary)

(http:export-url #u"/test.zip" :zip-file
                 :pathname #p"/Users/joswig/Desktop/my-test-zip-file.zip")  ; example pathname


Does that help?


Best regards,

Rainer




Am 17.07.2013 um 05:11 schrieb Mark Klein <[email protected]>:

> 
> I'd like to allow my cl-http based system to download a zip file to the user. If I use something like:
> 
> (defmethod download ((url url:http-computed-url) stream)
>   (http:with-successful-response (stream :text :additional-headers '(:content-disposition (:attachment :filename "/tmp/scenarios.zip")))))
> 
> the downloaded attachment has zero length, probably because the mime type (:text) is wrong? But it looks like cl-http does not have a mime type defined for zip files. What should I do? Could someone show me how to define the mime type for zip files, if that's the solution?
> 
>    Thanks!
> 
> 	Mark
> 
> -------------------------------
> Mark Klein
> Principal Research Scientist
> MIT Center for Collective Intelligence
> http://cci.mit.edu/klein/
> 
> 


_______________________________________________
WWW-CL mailing list
[email protected]
https://lists.csail.mit.edu/mailman/listinfo/www-cl