I'm going to develop an application for uploading video & audio from iPhone to web server.I know how to upload to web server by HTTP Post or FTP,but I'm not sure whether I can access the audio files in the specific path like 【/private /var/ mobile/Media /iphone video Recorder】 on iPhone bacause Apple will rejects request that attemp to access the files out of sandbox. Dose anyone knows is it reachable? If not,what can I do ?
A:
It's reachable using:
NSData *data = [NSData dataWithContentsOfFile:@"YOUR_DIRECTORY"];
By the way, if you're unsure, you can always use:
NSArray *array = [[NSFileManager defaultManager] directoryContentsAtPath:@"YOUR_DIRECTORY"];
to list the directories.
And for both methods, you can access the WHOLE FILESYSTEM (at least you can with the 4.1 beta I'm using)
From there, you'll have to build a way to upload it to the web server
I'm pretty sure Apple allows you to use these methods in your app, but I'm not 100% sure.
Matt S.
2010-08-19 02:03:39
many thanks,I will have a try.
2010-08-19 04:49:39
If it works be sure to click the checkmark :) then I'll finally reach 1000 rep!
Matt S.
2010-08-19 14:39:11