views:

39

answers:

1

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.
many thanks,I will have a try.
If it works be sure to click the checkmark :) then I'll finally reach 1000 rep!
Matt S.