0

I have a button that when pressed opens a file dialogue. I want to filter the files available for selection to just: pdf, docx, html, rtf and txt.

I have been trying to use the html accept tag, but compared to the desktop version the android one seems a little bit weirder, for example pdfs can be filtered with application/pdf but not .pdf and text/* allows nearly all files but .txt does not work.

Does any one have a guide for filtering with html in Android, all I can find is how to use image/* or audio/* which is not useful.

Hardik Pithva
  • 1,729
  • 1
  • 15
  • 31
Lawtonj94
  • 309
  • 1
  • 5
  • 16
  • Maybe this helps? http://stackoverflow.com/questions/3592717/choose-file-dialog – cherry-wave Jun 01 '16 at 09:11
  • not rally I have to do it though the html as its a web application so it is runing JavaScript. I got to this point but the line just refuses to work on android. – Lawtonj94 Jun 01 '16 at 09:38
  • A so you are using a WebView? Do you load an html file into the WebView? Does the hole application need to be html? – cherry-wave Jun 01 '16 at 09:57
  • I am translating a web application to Android using a cordova build, but file filter is not working on android, I know you can filter using html "accept" tag. e.g. ` accept="application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/rtf,text/html,text/plain,application/pdf" ` but for me its not working the commas just seem to break it – Lawtonj94 Jun 01 '16 at 10:02

0 Answers0