jQuery UI Widgets › Forums › Editors › FileUpload › Format of multiple Accept entries
Tagged: jqxFileUpload
This topic contains 6 replies, has 2 voices, and was last updated by Craig Matthews 9 years, 7 months ago.
-
Author
-
I am looking for a way to limit the types of files that can be specified in jqxFileUpload.
I see the accept property, but cannot determine how to specify multiple file extensions, such as bmp, csv, doc, pdf, txt and xls.
Please provide an example.
Thank you.
Hi Craig Matthews,
The same way you to it for the INPUT with type – file. String with commas. We set the “accept” attribute of the internal file input to the value you set.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter Stoev,
I tried the example from the jqxFileUpload documentation under the accept property.
accept: ‘image/*,audio/*’
returns all images and audio files.accept: ‘jpg,pdf’
accept: ‘.jpg,.pdf’
accept: ‘*.jpg,*.pdf’
all return all files.The INPUT with type “file” accept refers to the “IANA Media Types”, whereas your documentation states that jqxFileUpload accepts those and “any file extension, for example: ‘.gif’, ‘.jpg’, ‘.png’, ‘.doc’, etc.”.
I cannot find “IANA Media Types” for the types of files I want to allow to be uploaded.
So, I am asking how to specify the acceptable file extensions.
I realize that I can intercept the request and not allow an extension that I do not want to allow to be uploaded. but it would certainly look more professional if I simply did not allow the selection of non-allowed file types in the first place.
Thank you.
Hi Craig Matthews,
We set the “accept” attribute of the internal file input to the value you set. This basically means that your Property’s Value and Attribute’s Value are the same. Which part of the above is not clear?
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/What is not clear is that the documentation says that file extensions are acceptable, but the example uses the “IANA Media Types” codes and I am looking for an example that shows specifying (multiple) file extensions, because, as I indicated I cannot get that to work.
Thank you.
Hi Craig Matthews,
“accept” property of jqxFileUpload and “accept” attribute of INPUT with type=”file” are synchronized. This basically means that you can have the Same Accept values in jqxFileUpload which you have with the INPUT. This may not be clearly stated in the documentation, but I already wrote it here.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com/Hi Peter Stoev,
The root problem was that the accept attribute does not work in Firefox, and I was using Firefox. It works properly in Chrome.
Thank you.
-
AuthorPosts
You must be logged in to reply to this topic.