1
votes

When I try to load a shared item, the data that comes back is dropbox's login page - as if I weren't authenticated.

Here is the current method I am using to get the file data:

[itemProvider loadItemForTypeIdentifier:docType options:nil completionHandler:^(NSURL *url, NSError *error) {
    //my code
}];

doctype is an appropriate kUTType like kUTTypeImage or kUTTypeText, for example. The mimeType that we write the file with is correct to, per other files. It's the actual content loaded from dropbox (just a login page every time).

I have used other variations of the method (UIImage *, and NSData *) but get the same result for dropbox files.

Our shared extension works fine with files that are downloaded in apps like goodreader or Files. The problem arises when I try to share a file from the dropbox app. It gives me a url that I can put into any browser and it will take me to the file, so the url is not the problem.

Has anyone else faced this?

Here is an example link to a document that does this:

https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=0

1
Do you have a sample link you can share?Greg
I've updated my post and included a sample url the behaves this way.Herbal7ea
If you're trying to download files from links like this, you'll need to modify them to get the direct file content: dropbox.com/help/201Greg
@Greg you may want to answer this question: stackoverflow.com/questions/28311392/… There's currently a bounty.Murray Sagal

1 Answers

0
votes

Thank you for your help on this Greg. I found that this worked instead by just changing the url and setting dl=1 like so

From: https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=0

To https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=1