I want to make the following webpage using CocoaHTTPServer: there should be a link to download a file, but the source file must be NSData object in memory.
As far as I see in samples, there is an easy way to link some file on iPhone to the hyperlink. Is it possible to "link" NSData?
Would be very thankful for examples.
All you need to do is to return
HTTPDataResponsein your HTTPConnection subclass.If you want an example have a look at the CocoaHTTPServer sample called
DynamicServerand replace- httpResponseForMethod: URI:inMyHTTPConnectionwith something similar to the following: