i'm having a array of web urls redirecting images. Is it possible to download images directly and save it using its default file name.
Asked
Active
Viewed 28 times
1 Answers
0
NSData *data=[NSData dataWithContentsOfURL:[NSURL URLWithString:webImageURL]];
[data writeToURL:localURL atomically:YES];

Parag Bafna
- 22,812
- 8
- 71
- 144
-
if the url is http:rockers.net/apple.jpeg, then save it as apple.jpeg – user23790 May 22 '13 at 12:44
-
how to get file name from web url – user23790 May 22 '13 at 12:45
-
use lastPathComponent method of NSURL. [webImageURL lastPathComponent]; – Parag Bafna May 22 '13 at 12:49