CulturalMe / meteor-slingshot

Upload files directly to AWS S3, Google Cloud Storage and others in meteor
MIT License
595 stars 104 forks source link

Slingshot doesn't support .docx mimetype ? #208

Closed bloodbee closed 7 years ago

bloodbee commented 7 years ago

Hi.

I have a problem to accept the .docx mimetypes (application/vnd.openxmlformats-officedocument.wordprocessingml.document) in the slingshot file restrictions.

Setting this in the server : Slingshot.fileRestrictions("resumes", { allowedFileTypes: ["image/png", "image/jpeg", "image/jpg", "image/tiff", "image/x-tiff", "application/pdf", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/msword"], maxSize: 10 * 1024 * 1024 });

Throw this error : errorClass {error: "Upload denied", reason: "application/vnd.openxmlformats-officedocument.word…image/x-tiff, application/pdf, application/msword", details: undefined, message: "application/vnd.openxmlformats-officedocument.word…plication/pdf, application/msword [Upload denied]", errorType: "Meteor.Error"} details: undefined error: "Upload denied" errorType: "Meteor.Error" message: "application/vnd.openxmlformats-officedocument.wordprocessingml.document is not one of the followed allowed file types: image/png, image/jpeg, image/jpg, image/tiff, image/x-tiff, application/pdf, application/msword [Upload denied]" reason: "application/vnd.openxmlformats-officedocument.wordprocessingml.document is not one of the followed allowed file types: image/png, image/jpeg, image/jpg, image/tiff, image/x-tiff, application/pdf, application/msword" stack: (...) get stack: stack() set stack: stack() __proto__ : Error

Can you please add support for this mimetypes ? Thank you :)

mvcdev commented 7 years ago

Hi @bloodbee, did you find a solution? I am also not able to upload docx file

SeanBarry commented 6 years ago

@bloodbee @mvcdev in case you didn't work this out yet -

Add this: application/vnd.openxmlformats-officedocument.wordprocessingml.document to your allowedFileTypes array and it will work!

bloodbee commented 6 years ago

As @SeanBarryUK said, his answer is perfect for fixing this issue.