0

I want to be able in my app to upload files from my computer(windows,mac...) to the iPhone,so i an looking for a source code in objective-c that open server on iPhone,

but my question is, how i implement an upload from my computer to the device?

Edit


I want to upload the file from a computer that is on the same Network like the device, something like : the user will open browser and select a file and it will be upload to the device.

i found CocoaHTTPServer but i really didn't understand how to upload a file to the iPhone with this.

YosiFZ
  • 7,792
  • 21
  • 114
  • 221

1 Answers1

0
  1. you probably want to upload the file to FTP-server, that shouldn't be a problem.
  2. set up a webservice or json on your server to know what changed, or should be downloaded (depends heavily on your business logic of your app) - it could also be a static textfile
  3. now the problem is how the app knows that there is are new files.
    • option 1: poll server if user presses a button or on every app start, etc.
    • option 2: send push notification to your iPhone app, if there are new file.

polling the server would be very easy to implement, compared to sending push notification.


EDIT: alright i read your edited post. hosting a local webserver on an iphone sounds still weird to me.

another possible solution, that could work for you - if you only want to transfer only a few and rather small files:

  • enable Document Interaction in your app.
  • this would allow the user to send the file by mail to your iphone and open the document with your app with the "open in..." dialog .
JeanLuc
  • 4,783
  • 1
  • 33
  • 47