Hello! Here is a code snippet: At the trivial pülace you can set whatever mime type yout think will work for you. I hope this helps. Robert -------------------------------------------------------------- sendFile |contents stream | stream := FileStream readOnlyFileNamed: self file. stream binary. contents := stream contents. stream close. self requestContext respond: [ :response | response *contentType: 'application/x-msdownload';* document: contents; attachmentWithFileName: self fileName ]. chicoary <chicoary@gmail.com> ezt Ãrta (idÅpont: 2016. febr. 10., Sze, 14:08):
Thanks Sven for your reply.
The curl I want reproduce with Zinc is:
curl 'http://localhost:5001/api/v0/add?stream-channels=true' \ -H 'content-type: multipart/form-data; boundary=a831rwxi1a3gzaorw1w2z49dlsor' \ -H 'Connection: keep-alive' \ --data-binary $'--a831rwxi1a3gzaorw1w2z49dlsor\r\nContent-Type: application/octet-stream\r\nContent-Disposition: file; name="file"; filename="file.txt"\r\n\r\nfile.txt contents--a831rwxi1a3gzaorw1w2z49dlsor--' --compressed
It is like an example in https://github.com/ipfs/js-ipfs-api#tooling.
I want to implement the ipfs add command in my project http://smalltalkhub.com/#!/~chicoary/SmallIPFS/.
----- http://chicoary@gmail.com -- View this message in context: http://forum.world.st/How-to-generate-Content-Type-application-octet-stream-... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.