Current upload does not support inclusion of mime-type
See original GitHub issueOur current upload/update methods do not include the mime-type. As such, when we upload photos to storage and download them again they don’t render properly.
The current fix was proposed by John on the discord channel. We should integrate it in so that Users can download/use photos.
multipart_data = MultipartEncoder(
fields={
"file": (
"party-parrot.gif",
open("./out/party-parrot.gif", 'rb'),
"image/gif"
)
})
formHeaders = {
"Content-Type": multipart_data.content_type,
}
headers = dict(supabase._get_auth_headers(), **formHeaders)
response = requests.post(
url=request_url,
headers=headers,
data=multipart_data,
)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Upload MIME type restriction (instance security hardening)
(Medium) To reduce vulnerabilities such as file inclusion and malicious file uploads, MIME type verification should be enabled. References ...
Read more >MIME types (IANA media types) - HTTP - MDN Web Docs
A MIME type most-commonly consists of just two parts: a type and a subtype, separated by a slash ( / ) — with...
Read more >422 error when file extension does not match mime type - Drupal
Problem/Motivation When uploading a file where the extension doesn't match the detected mime type, a 422 error is returned.
Read more >ColdFusion 10 CFFILE Accept mimetype not recognised
The issue is, as the error states, that the mime type of the uploaded file is "application/octet-stream" not "video/x-ms-wmv". I tried to point...
Read more >Manual:MIME type detection - MediaWiki
MediaWiki tries to detect the MIME type of the files you upload, and rejects the file if the file-extension does not match the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hey @julianolf,
The tests are commented out because the current test instance does not have the test bucket and will fail upon execution. Unfortunately I don’t have access to the last bucket so we need to swap out the credentials(That’s on me). Feel free to go ahead and write your own tests or just do a manual test with an instance of your own.
I will update the credentials within the next 24h
Yup @julianolf,
We are closing for now but feel free to let us know if you still face any further issues.
Thanks!