Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Transferring files from iPhone to desktop

I am looking for guidance.

I am fairly unclear on how to transfer files from the iPhone to your desktop., either mac (and/or pc). Does anybody have any high level (or detailed) direction on where to begin.

Thanks,

James

iPhone, Other OS

Posted on Jul 23, 2008 10:41 AM

Reply
5 replies

Jul 23, 2008 10:48 AM in response to Digital Agua

If you are trying to get files off of your iPhone for debugging you can go to the Organizer in XCode. Under the installed applications you can expand your application. Below that you will see "Application Data". Click on the down arrow next to "Application Data". This will transfer the application data to your computer. You can browse it in the organizer under "Projects & Sources".

If you want users to be able to get files off of their iPhones to their PC I believe that they only way to do this is through your web server. Have your iPhone app upload the files to your web server and then let users download them.

Stephen

Jul 30, 2008 12:08 PM in response to rearcog

Have you been able to actually get this to work? I've been looking at it for some time with no such luck. I am writing a small file to the Documents directory, supposedly, yet nothing shows up in he Organizer's data dump.

I have tried both C's stdio routines and NSFileHandle routines.

I am getting a valid handle back from the open() call, write() shows the expected number of bytes written, but nothing shows.

And example filepath is : /var/mobile/Applications/5D5C66F0-C25F-402E-90A7-1167062E57D7/Documents/stringD ump.txt

The data is written out in the Simulator's directories, but never on the device.

I did try immediately reopening the file after closing it and get a -1 handle, so it seems as if the data is never actually being written out even though the functions claim it is.

Any ideas?

Jul 30, 2008 12:34 PM in response to Proxima

I was only able to get the file through the organizer with the latest 2.0 SDK (I haven't tried the 2.1 yet). To test the file creation you can use the simulator and check ~/Library/Application Support/iPhone Simulator/User/Application. In there you will find the folder for your application and the Documents folder within that.

To get the path I am doing

NSFileManager* fileManager = [NSFileManager defaultManager];
NSArray* docDirectories = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

if ([docDirectories count] > 0)
{
NSString* docDir = [docDirectories objectAtIndex:0];
const char* cDocDir = [docDir UTF8String];
}


Then I use standard fopen, fread, fwrite, etc for the file access.

Stephen

Transferring files from iPhone to desktop

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.