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

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

parent 13496d90
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
NSURL *_tempURL; NSURL *_tempURL;
} }
- (void)updateMediaList;
@property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController; @property (nonatomic, readonly) VLCPlaylistViewController *playlistViewController;
@property (nonatomic, strong) UIWindow *window; @property (nonatomic, strong) UIWindow *window;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import "VLCHTTPUploaderController.h" #import "VLCHTTPUploaderController.h"
#import "VLCAppDelegate.h"
#import "DDLog.h" #import "DDLog.h"
#import "DDTTYLogger.h" #import "DDTTYLogger.h"
...@@ -202,7 +203,10 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE ...@@ -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. // an empty form sent. we won't handle it.
return; 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; BOOL isDir = YES;
if (![[NSFileManager defaultManager]fileExistsAtPath:uploadDirPath isDirectory:&isDir ]) { if (![[NSFileManager defaultManager]fileExistsAtPath:uploadDirPath isDirectory:&isDir ]) {
...@@ -239,6 +243,10 @@ static const int httpLogLevel = HTTP_LOG_LEVEL_VERBOSE; // | HTTP_LOG_FLAG_TRACE ...@@ -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. // as the file part is over, we close the file.
[storeFile closeFile]; [storeFile closeFile];
storeFile = nil; storeFile = nil;
/* update media library when file upload was completed */
VLCAppDelegate* appDelegate = [UIApplication sharedApplication].delegate;
[appDelegate updateMediaList];
} }
@end @end
Supports Markdown
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