623
Views
4
Comments
Specify mime type in upload file widget or Camera Plugin in Mobile App
Question

Hi ,

When user upload file from mobile, I want to restrict user to upload Docx, PDF ,JPEG file only.

In upload widget , when i set accept "Any"  user can upload all file. Even i try to assign accept as extended property, accept="image/jpeg,application/pdf" , it wont work.

In camera plugin , when i set media type "ALL MEDIA".It allow user to select all type of file.

I don't want to validate file type after user select file, My requirement is user won't able to see other type of files during upload.

How to restrict user to select only DOC,PDF,JPEG file from mobile Storage?

Also i have to check size of file within plugin.

Thanks,


2023-02-10 19-42-59
João Melo
 
MVP

I haven't tried this yet, but it must work as it's html5. Try to use the accept tag as an extended property. Here is how to use it:

https://stackoverflow.com/questions/7575482/restrict-file-upload-selection-to-specific-types

2022-10-20 02-09-39
JeffT

Hi joa ,

I already tried with "accept" as extended property as i mentioned it in my post before.It not work with "ANY" "Accept" as upload property for mobile .


2023-02-10 19-42-59
João Melo
 
MVP

Hi Rocky. Sorry, I for not noticing the detail in your previous description.

Well, I just created a demo mobile app, and it worked fine for me. Take a look at the attachment and tell me if it helps.

TestMobile.oml
2022-10-20 02-09-39
JeffT

Hi Joa,

I tried your oml. In documents option  it allow me to select all types(docx,html,jpeg etc) of files , i dont want user to see other type of file only specific file will be visible. I am using android phone.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.