PDA

View Full Version : Is it possible to create a file on the iPhone and export it onto a computer's disk?




fenrus110
Mar 9, 2009, 03:45 PM
Here is what I want to do
1) create a simple text file on the iPhone. such as saving some text from a UITextView

2) export or drag and drop that file onto the hard drive of my computer for viewing. Kinda like how they do the WebDav, wireless USB type things.

The main issue I'm pondering is if I can create a file and have it accessible. I know there sandbox limits and stuff.

I've done something smiliar by uploading my text to a server and having the server send the user an email with a text file the server generated. But my client wants to do it purely iPhone -> computer



dejo
Mar 9, 2009, 03:57 PM
1 - Possible.
2 - Not possible.

fenrus110
Mar 9, 2009, 03:59 PM
that's what I thought. the file I created within the app, stays in the app right?

Niiro13
Mar 9, 2009, 11:54 PM
Actually, I think both are possible as long as you save to the correct location.

While I am currently a developer, I haven't worked with the WebDAV thing so I don't know it's full capabilities, but I know you can save files to the Documents Directory. Adn since that's the only directory with local read/write, I figured that's where the applications like Air Sharing or DataCase point to.

CocoaPuffs
Mar 10, 2009, 02:07 AM
Actually, I think both are possible as long as you save to the correct location.

While I am currently a developer, I haven't worked with the WebDAV thing so I don't know it's full capabilities, but I know you can save files to the Documents Directory. Adn since that's the only directory with local read/write, I figured that's where the applications like Air Sharing or DataCase point to.
Not quite, each app is in its own sandbox, so it doesn't matter where you save it, you won't be able to export the file, other than through the web using XML of sort.

caveman_uk
Mar 10, 2009, 03:32 AM
You can do 2 - sort of. You need to have your app run some sort of server. HTTP servers are probably best so you can get to the file using a web browser.

You may find this useful

http://deusty.blogspot.com/search/label/HTTP%20Server

fenrus110
Mar 10, 2009, 06:53 PM
You can do 2 - sort of. You need to have your app run some sort of server. HTTP servers are probably best so you can get to the file using a web browser.

You may find this useful

http://deusty.blogspot.com/search/label/HTTP%20Server

I looked at this briefly. While I am hardly an expert on networking I think the problem is the same. The file is created externally from the iPhone, so it does not have the restrictions. I'm trying to create the file within the iPhone before exporting it, which creates the problem with sandboxing...

caveman_uk
Mar 11, 2009, 03:21 AM
If you run a server on the iPhone then you can download files from it just like you can any other webserver. The sandboxing doesn't come into it at all - so long as the server is running in the same app that created the file on the iPhone. They can't be separate.