views:

31

answers:

2

I need to download a file from an url and save it to local cocoahttpserver I have in my iphone app so that later i can access it using something like http://localhost/filename.txt

I have the cocoahttpserver code. But I am unable to figure out how to save files to it. Any help would be great.

Thanks.

A: 

You could configure both your file's download directory and the http server to access your app's Documents directory.

hotpaw2
The server's document root is the Documents directory of iphone. But how do I access it with a url? I tried http://127.0.0.1:<someport>/filename.txt I even tried substituting the local ip and the internet ip address, but it doesn't get the file.
Hetal Vora
A: 

I wrote this code some month ago.

It is a Server based on cocoahttpserver. You will also find file download in it, as I added some js and a favicon. It is still very rough, I just don't have enough time to make it better :)

vikingosegundo