Commit bd1684b8 authored by Felix Paul Kühne's avatar Felix Paul Kühne

http upload: fix upload location so it's actually working now

parent 13496d90
......@@ -14,6 +14,8 @@
NSURL *_tempURL;
}
- (void)updateMediaList;
@property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController;
@property (nonatomic, strong) UIWindow *window;
......
......@@ -7,6 +7,7 @@
//
#import "VLCHTTPUploaderController.h"
#import "VLCAppDelegate.h"
#import "DDLog.h"
#import "DDTTYLogger.h"
......@@ -202,7 +203,10 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
// an empty form sent. we won't handle it.
return;
}
NSString* uploadDirPath = [[config documentRoot] stringByAppendingPathComponent:@"upload"];
// create the path where to store the media
NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* uploadDirPath = searchPaths[0];
BOOL isDir = YES;
if (![[NSFileManager defaultManager]fileExistsAtPath:uploadDirPath isDirectory:&isDir ]) {
......@@ -239,6 +243,10 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE
// as the file part is over, we close the file.
[storeFile closeFile];
storeFile = nil;
/* update media library when file upload was completed */
VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate updateMediaList];
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment