Page 1 of 1

upload files (not just images)

Posted: Wed Mar 20, 2013 3:25 pm
by prot984

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 ????


upload files (not just images)

Posted: Wed Mar 20, 2013 3:31 pm
by maxkatz

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


upload files (not just images)

Posted: Thu Mar 21, 2013 8:42 am
by prot984

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 ?


upload files (not just images)

Posted: Thu Mar 21, 2013 10:47 am
by Kateryna Grynko

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


upload files (not just images)

Posted: Thu Mar 21, 2013 11:53 am
by prot984

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.


upload files (not just images)

Posted: Thu Mar 21, 2013 1:14 pm
by Kateryna Grynko

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?


upload files (not just images)

Posted: Fri Mar 22, 2013 7:54 am
by prot984

I would like to accept pdf or ms word files


upload files (not just images)

Posted: Fri Mar 22, 2013 8:56 am
by Illya Stepanov

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


upload files (not just images)

Posted: Fri Mar 22, 2013 9:52 am
by prot984

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????


upload files (not just images)

Posted: Fri Mar 22, 2013 10:37 am
by Kateryna Grynko

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.