We are aware of the issue with the badge emails resending to everyone, we apologise for the inconvenience - learn more here.
Forum Discussion
Craig M.21
10 years agoNew member | Level 2
Dropbox should respond to Android Intent.ACTION_SEND
My android app uses the code below to allow users to back up an important file. A number of applications, including Google Drive, appear as suitable services to handle the file, but Dropbox does not appear, even though it offers the same functionality as Google Drive. Could you please change Dropbox so that it appears and my users can access it in this way?
File F = new File(sdPath);
if(F.exists()){
Uri U = Uri.fromFile(F);
Intent i = new Intent(Intent.ACTION_SEND);
i.setType("file/*");
i.putExtra(Intent.EXTRA_STREAM, U);
startActivity(Intent.createChooser(i,"Email/Upload '" + filename + "'"));
}
- Steve M.Dropbox Staff
The Android app doesn't support the MIME type file/*, but we do support these ones:
- application/*
- audio/*
- image/*
- text/*
- video/*
- multipart/*
- NATTSOENew member | Level 2image/*
- Adrien B.1Helpful | Level 6
That was a little pain, but I found a temporary workaround.
It looks like the last update broke a little bit of its Intent parsing.If you want a Dropbox share to work (currently 2016/05/09), you'll have to remove the EXTRA_TEXT from your Intent.
The following exemple works, but it ruins the mail share :
Uncomment the line to see the Dropbox app bad behaviour.Intent intentShareFile = new Intent(Intent.ACTION_SEND);
intentShareFile.setType("application/pdf");
intentShareFile.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(myFile));
intentShareFile.putExtra(Intent.EXTRA_SUBJECT, "My subject");
// intentShareFile.putExtra(Intent.EXTRA_TEXT, "My text");
startActivity(Intent.createChooser(intentShareFile, "Choose"));It seems that a few apps sadly choosed to remove this Extra to make Dropbox works.
This thread is still relevant : Dropbox should properly parse and propery respond to an Intent.SHARE. - Craig M.21New member | Level 2
Thanks for the response. Using "application/*" appears to have soled the upload issue. Is there any good reason that "file/*" is not supported? Many android code samples recommend "file/*' for non-standard file types and my first impulse on not seeing Dropbox n the list was actually to tell my users to use Google Drive instead of Dropbox.
I have been unable to test the integrity of the uploaded file because Dropbox is producing another problem on attempted download (a problem I did not face with Google Drive) - but I will post that as a separate issue.
- Steve M.Dropbox Staff
I wasn't aware of the convention around using "file/*", but I'll pass this along to the team. If that's the recommendation on Android, I imagine we can add support in a future version of the app.
- Steve M.Dropbox Staff
Do you happen to have any links handy to where people are using "file/*"? I'm trying to figure out how common it is.
We may simply be able to support "*/*", which is what it appears Google Drive does.
- AntonioCDropbox Staff
Hi everyone, we've landed a fix for this that should be out in early June. Thank you for your patience!
- AntonioCDropbox Staff
Hi Gil, this issue has been resolved on our 10.2 release which should be out to the Play Store by next week.
- Craig M.21New member | Level 2
Hi there, it is not so much an official recommendation as a common feature of code snippets provided at places like Stack Exchange. Since it works well with lots of other apps (email, Google Drive, and so on), DropBox is the odd one out. The use of 'application' seems to be a fine substitute, but some developers will not bother looking for a DropBox-specific solution.
- Craig M.21New member | Level 2
Actually, looking around now, it does not seem to be common. I think I picked up 'file/*' from snippets provided for getting content, not sending content, but then combined it with other snippets designed for sending plain text or images. My specific requirement is that I wanted an all-purpose attachment/upload service, not one restricted to any known file type, and 'application/*' achieves this. The thing is, the above code worked immediately for a wide range of apps/services, so I almost stopped at that point and assumed DropBox was not willing to play ball.
I guess if you respond to */* that should be enough to satisfy other developers who try file/*, but in truth there might not be many. If there is no reason not to respond to */*, though, you might as well be flexible. DropBox doesn't seem to care what type of file it is, so why filter it?
Anyway, thanks for your help - you solved the issue for me.
- Steve M.Dropbox Staff
Okay, thanks. The team will continue investigating whether it makes sense to just support
\*/\*
in the future.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,877 PostsLatest Activity: 12 months agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!