I created a Doctype and WebForm to upload Audio. but for some reason when a user is a Customer, and tries to attach / upload an mp3 or wav file, it throws a 417 error.
Imagens, txts and pdfs work though.
In frappe/handler.py you need to add the audio file extensions in the ALLOWED_MIMETYPES tuple.
Not sure if this was an oversight or left out on purpose for security reasons.
Thank you so much for the quick response, that makes sense.
I added it :
ALLOWED_MIMETYPES = (
“image/png”,
“image/jpeg”,
“application/pdf”,
“application/msword”,
“application/vnd.openxmlformats-officedocument.wordprocessingml.document”,
“application/vnd.ms-excel”,
“application/vnd.openxmlformats-officedocument.spreadsheetml.sheet”,
“application/vnd.oasis.opendocument.text”,
“application/vnd.oasis.opendocument.spreadsheet”,
“text/plain”,
“video/quicktime”,
“video/mp4”,
“audio/mp3”,
“audio/wav”,
)
But still get the same problem, it happens with user Customer (Website User). But not with an admin.
Thank You!! That worked!!
The correct MIME type for mp3 is audio/mpeg, after changing that it worked!