-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc docx content types fail #18
Comments
Hi @mooru , Do you have any validation errors? |
I just updated the tests for |
Thanks for your response. I changed the mimetype to application/zip but still not working. I will also try and run magic and see what happens |
Hello @mbourqui |
@mooru That's a problem with the crispy form library. It is not showing errors for django fields "ImageField" and "FileField". The easiest workaround for now is to add the following CSS code to the page you are showing these inline form errors.
Another workaround is to override |
I found a different work around with CrispyForms. Since Crispy automatically forces users to fix errors in the form, if an error passes through, it must be because of a file type error. So you can simply add this to your view:
This has the benefit of not giving the MIME type error code for security reasons, and user experience. |
Hi. First, thanks for this package. I'm having a related issue. With some MSWord formats, MIMEMagic is identifying the MIME type incorrectly: see mimemagicrb/mimemagic#50. In my case, .doc files are being recognized as This app uses both the file type and file size constraints. My client wanted both messages presented if both constraints fail. So I did my own clean on the field. Back to the issue... in my django form when I clean the constrainedfilefield, I can see the content-type is Is there a recommended way to work around this issue? The obvious, but obviously wrong way is to add this wrong type to the list of ok file types. Thanks |
I am trying to implement this plugin and have the following content types in my model
but it only seems to save when i add a pdf to field. it fails when i add a doc or docx file. Any way to work aorund this
The text was updated successfully, but these errors were encountered: