/ Published in: ActionScript 3
Get a filename part from a NSURLRequest. Optionally remove extension
Expand |
Embed | Plain Text
- (NSString *)getFilenameFromRequest:(NSURLRequest *)request avoidExtension:(BOOL)avoidExtension { NSString *filePath = [[[request URL] path] lastPathComponent]; if (avoidExtension) { NSArray *a = [filePath componentsSeparatedByString:@"."]; return [a objectAtIndex:0]; } return filePath; }
You need to login to post a comment.
