0

I am making an iphone application which is pretty much like forum. People can ask question and upload a pdf/doc file along with the question. Is there a way to access the pdf/doc file in iphone when user clicks upload button and send the file to server?

I have implemented the feature for image for which I used UIImagePicker to pick the image and send it to the server with http request. But I am completely lost and have no idea how to handle pdf/doc files in same manner.

Any help/suggestion really appreciated. Thanks in advance.

2 Answers2

3

If you want to upload PDF and Doc files, then you can integrate Dropbox and Google Drive in your app and then select the files ,as Apple does not have centralised storage. If you notice Apple also chooses the documents from Google Drive while composing a mail. So implementing and integrating google drive and Dropbox would be a good option.

Here is the link for Dropbox https://www.dropbox.com/developers-v1/core/sdks/ios

Here is the link for Google Drive https://developers.google.com/drive/ios/quickstart

Implementing Google drive is a bit hard but dropbox is quite simple.

Wish it saves your time. All the best!

Kunal Gupta
  • 2,984
  • 31
  • 34
0

I think you are looking for a combination of two things (both have been discussed here before and I include the links below).

(1) store a PDF. There are many options but the best way is to allow coredata to save outside the persistent store. Then store the reference to the file in core date. See: Insert a PDF file into Core Data?

(2) send the file to the server. There are many options for this as well. The fastest is probably to use a wrapper library such as ASIHTTPRequest. See: File Upload to HTTP server in iphone programming

Community
  • 1
  • 1
Mika
  • 5,807
  • 6
  • 38
  • 83