Skip to content

Commit

Permalink
use percent encoding for filename header
Browse files Browse the repository at this point in the history
  • Loading branch information
moshee committed Mar 31, 2014
1 parent 478b39a commit 4ed3db1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Airlift/ALUploadManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ - (id)initWithFileURL:(NSURL*)fileURL
shouldDeleteFile = shouldDelete;
targetFilePath = fileURL;

NSString* fileName = [[targetFilePath path] lastPathComponent];
NSString* fileName = [[targetFilePath lastPathComponent]
stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%@", fileName);
[request setValue:fileName forHTTPHeaderField:ALRequestHeaderFilename];

upload = [session uploadTaskWithRequest:request fromFile:targetFilePath];
Expand Down

0 comments on commit 4ed3db1

Please sign in to comment.