I need to serve a file on localhost to a certain application which only accepts http URI-s. However, the files are generated on the fly and I would like to avoid writing to disk, so I decided to write a simple HTTP server using QTcpServer. Luckily, I even found a nice tutorial explaining just that. However, I’m not familiar with HTTP responses. How do I serve a flash file? Is there a particular MIME type for that? And after putting the header together, do I just dump the stream to the socket and that’s all?
Share
The mime type you are looking for is:
application/x-shockwave-flashWhat you need to set is
application/x-shockwave-flashContent-Disposition=attachment;filename=SWFToServe.swfAnd that’s all, the client should start downloading it…