jquery - acceptFileTypes Blueimp fileupload -


i have implemented jquery fileupload, have small issue accepted file types:

$('#fileupload').     url: '/upload/uploaddoc', // url zum file upload     type: 'post',     datatype: 'json',     uploadtemplate: 'template-upload',     acceptfiletypes: /^.*\.(?!exe$|lnk$)[^.]+$/i,     maxfilesize:allowed_file_size     .......  } 

i using regex recognize filetypes not allowed. want pass variable contains accepted file types in maxfilesize not seem accept lists , strings.

do know passed acceptfiletypes ?

you may use regexp constructor.

something like:

acceptfiletypes: new regexp("^.*\\." + my_condition_lookahead + "[^.]+$", "i"), 

note need double escape special regex meta characters when declaring regex using constructor notation.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

Nuget pack csproj using nuspec -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -