Re: exporting a file from cl-http
Martin Simmons <[email protected]> Wed, 6 Jul 2011 12:23:03 +0100
| Newsgroups | gmane.lisp.cl-http |
|---|---|
| Message-ID | <[email protected]> |
It should be something like '(:content-disposition (:attachment :filename "My Text File.txt")) -- Martin Simmons LispWorks Ltd http://www.lispworks.com/ >>>>> On Tue, 5 Jul 2011 15:47:11 -0400, Mark Klein said: > > I tried putting the following in my cl-http response function: > > (http:with-successful-response (stream '(application octet-stream) > :additional-headers '(:content-disposition "attachment;filename=\"My > Text File.txt\"")) > > > but the browser gave me the error: > > Internal Server Error > > Required arguments in "attachment;filename=\"My Text File.txt\"" don't > match lambda list (HTTP::DISPOSITION . HTTP::PARAM-PLIST). > CL-HTTP/70.216 (Clozure Common Lisp; 0.9.91) > > > I assume I gave the wrong format for the :content-disposition header; do > you know what the correct one is? > > Thanks, > > Mark > > >>>>>> On Fri, 24 Jun 2011 19:11:13 -0400, Mark Klein said: > >> > >> I'd like to provide a button in a cl-http generated web page that creates a > >> text file and then downloads it to the user's desktop. How can I do that? I > >> have no problem creating a file within a response function, I just don't > >> know how to tell the browser to download that file to the user's > >> machine. Any suggestions? > > > > Maybe you can adapt the article below, using the content-disposition header? > > > > http://stackoverflow.com/questions/186867/what-content-type-to-force-download-of-text-response > > > > -- > > Martin Simmons > > LispWorks Ltd > > http://www.lispworks.com/ > > > > _______________________________________________ > > WWW-CL mailing list > > [email protected] > > https://lists.csail.mit.edu/mailman/listinfo/www-cl > > ------------------------------- > 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