Posted By


gfazioli on 07/14/10

Tagged


Statistics


Viewed 627 times
Favorited by 0 user(s)

getFilenameFromRequest


/ Published in: ActionScript 3
Save to your folder(s)

Get a filename part from a NSURLRequest. Optionally remove extension


Copy this code and paste it in your HTML
  1. - (NSString *)getFilenameFromRequest:(NSURLRequest *)request avoidExtension:(BOOL)avoidExtension {
  2. NSString *filePath = [[[request URL] path] lastPathComponent];
  3. if (avoidExtension) {
  4. NSArray *a = [filePath componentsSeparatedByString:@"."];
  5. return [a objectAtIndex:0];
  6. }
  7. return filePath;
  8. }

URL: http://www.undolog.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.