Downloading image from server without file extension (NSData to UIImage)
- by Msencenb
From my server I'm pulling down a url that is supposed to simply be a profile image. The relevant code for pulling down the image from the urls is this:
NSString *urlString = [NSString stringWithFormat:@"%@%@",kBaseURL,profile_image_url];
profilePic = [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:urlString]]];
My url is in the format (note no file extension on the end since its dynamically rendered)
localhost:8000/people/1/profile_image
If I load the url in my browser the image displays; however the code above for pulling down the UIImage does not work. I've verified that the code does pull an image from a random site on the interwebs.
Any thoughts on why this is happening?