Skip to content

Commit

Permalink
Merge pull request robbiehanson#43 from ieswxia/master
Browse files Browse the repository at this point in the history
The SimpleFileUploadServer in sample cannot save files
  • Loading branch information
vronin committed Feb 15, 2013
2 parents f1cebb1 + aae77d9 commit ad14b56
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ - (void) processStartOfPartWithHeader:(MultipartMessageHeader*) header {
}
NSString* uploadDirPath = [[config documentRoot] stringByAppendingPathComponent:@"upload"];

BOOL isDir = YES;
if (![[NSFileManager defaultManager]fileExistsAtPath:uploadDirPath isDirectory:&isDir ]) {
[[NSFileManager defaultManager]createDirectoryAtPath:uploadDirPath withIntermediateDirectories:YES attributes:nil error:nil];
}

NSString* filePath = [uploadDirPath stringByAppendingPathComponent: filename];
if( [[NSFileManager defaultManager] fileExistsAtPath:filePath] ) {
storeFile = nil;
Expand Down

0 comments on commit ad14b56

Please sign in to comment.