Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tskoti

macrumors newbie
Original poster
Nov 5, 2008
6
0
Hi ,
Plz post me a sample code to Download a file to iphone /applications/..etc when the Download button is Pressed on the screen

Thanks in advance,
tskoti@yahoo.com
 

drivefast

macrumors regular
Mar 13, 2008
128
0
to download from an http server, you can use this to create an NSData object:
Code:
+ (id)dataWithContentsOfURL:(NSURL *)aURL
it may in fact work as well with an ftp server. on upload, it greatly depends how your server is expecting the file to be delivered.
 

tskoti

macrumors newbie
Original poster
Nov 5, 2008
6
0
how to create a file in Iphone

to download from an http server, you can use this to create an NSData object:
Code:
+ (id)dataWithContentsOfURL:(NSURL *)aURL
it may in fact work as well with an ftp server. on upload, it greatly depends how your server is expecting the file to be delivered.

Hi,please help me with a sample code to create a file in Iphone,and application have to read the content from that file....


thanks in Advance,
koti
 

dejo

Moderator emeritus
Sep 2, 2004
15,982
452
The Centennial State
Hi,please help me with a sample code to create a file in Iphone,and application have to read the content from that file....
We'll probably need a better idea of what the purpose of this file is and what its contents are before we can start giving you suggestions.
 

johnnybluejeans

macrumors 6502
Jan 16, 2006
294
0
New York, NY
Hi,please help me with a sample code to create a file in Iphone,and application have to read the content from that file....
thanks in Advance,
koti

There are examples of this all over the web. More importantly you can look at the Apple documentation for dataWithContentsOfURL and learn how it works, rather than just having someone write your program for you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.