prot984
Posts: 0
Joined: Thu Mar 14, 2013 1:16 pm

upload files (not just images)

I would like to have a button which allows users to select files stored in their mobiles and upload them.
I tested "Uploading Files to Tiggzi Database" and "File upload" tutorials you published but both tutorials are oriented to the images selection and upload.

I add the code
"code<form enctype="multipart&#47;form-data" method="post" name="fileinfo" style="visibility:hidden">
<fieldset>
<input type ="file" name ="fileselect" id="fileselect"><&#47;input>
<&#47;fieldset>
<&#47;form>/code
in the panel and $('#fileselect').trigger('click'); on button click,
and
when i test the application on the desktop web browser i can select every kind of file
but when i test on my android mobile i can select just images from my gallery

is there a way to browse among files stored in my mobile device ????

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

upload files (not just images)

Check if input type-"file" has any additional parameters or whether Android browser supports showing other files.

prot984
Posts: 0
Joined: Thu Mar 14, 2013 1:16 pm

upload files (not just images)

I'm testing my app with a Samsung galaxy s2 android 4.0.3 but the problem seems to be that android does not support a file picker opening for input type =file. Do you know if is there a workaround ?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

upload files (not just images)

Hi,

By default, on device you can select only images from gallery. To have ability to select another file types you should add attribute "accept" to tag :

code<input type="file" name="fileselect" id="fileselect" accept="*"><&#47;input>/code

prot984
Posts: 0
Joined: Thu Mar 14, 2013 1:16 pm

upload files (not just images)

i tried changing my previous code wit code<input type="file" <input type ="file" accept="&#46;pdf" name="fileselect" id="fileselect" accept="*"><&#47;input>/code

but what i got is a message : File chooser: unable to find an application to do this action.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

upload files (not just images)

Attribute "accept" points on what file types can be chosen on device.
It has Mime type value (http://en.wikipedia.org/wiki/Internet...).

If you want to select audio files you should write:codeaccept="audio&#47;"/code
For video files:codeaccept="video&#47;"/code
Tiggzi uses accept="image/*" by default.
What files do you want to select on phone?

prot984
Posts: 0
Joined: Thu Mar 14, 2013 1:16 pm

upload files (not just images)

I would like to accept pdf or ms word files

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

upload files (not just images)

Hi, in order to make selection of PDF or DOC files from the app you need the following code:

code<input type="file" name="fileselect" id="fileselect" accept="application&#47;pdf,application&#47;msword"><&#47;input>/code

prot984
Posts: 0
Joined: Thu Mar 14, 2013 1:16 pm

upload files (not just images)

i tested the code you suggested but what i got is still a message :

File chooser: unable to find an application to do this action.

i guess the problem is with the file chooser (picker) in android.
i'm tersting my app with a Samsung galaxy s2 android 4.0.3.
do you know if is there any way to access to a file chooser in Android????

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

upload files (not just images)

Hello,

Try the following code:

code<input type="file" name="fileselect" id="fileselect" accept="&#47;"><&#47;input>/code
Android would show all the possible variants to select file on device.

Return to “Issues”