Getting error while uploading docx file

I have created one form in which i have added browse button and with the below code i have added upload functionality

<div id="banner-uploader">
    <input placeholder="Choose a file to upload" type="file" name="featuredImage" id="image-uploader-input">
</div>

#set($contextId = $core_v2_uploadedFile.CreateContextId())

jQuery("#banner-uploader").glowUpload({
    uploadUrl: '$core_v2_uploadedFile.GetUploadUrl($contextId)',
    fileFilter: [{
        title: "pdf Files",
        extensions: 'pdf'
    }, {
        title: "Doc files",
        extensions: 'doc'
    }, {
        title: "Docx files",
        extensions: 'docx'
}],
    height: 50,
    width: 200
});

but when i am trying to upload docx file, getting below error (500)    

{jsonrpc: "2.0",

    error: {

        code: 100,

        message: "The file or url is invalid."},

        id: "id"

}

And it is working fine while uploading pdf file

Parents Reply
  • You likely don't want to enable a non-trusted user to override validation -- that will allow the user to upload *any* file.

    The alternative is to add pdf, docx, and doc to the list of allowed files in Administration > Moderation > Files.

    If you really want to enable a user to upload any file, you can go to Administration > Membership > Roles and create a new Role with the "Bypass Validation" permission then add users to this role by editing the role, going to the "Members" tab, and clicking "Add members"

Children
No Data