/ Published in: ActionScript 3
![](/img/icon_sav.png?v3)
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
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)