/ Published in: ActionScript 3

Get a filename part from a NSURLRequest. Optionally remove extension
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
- (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; }
Comments
