[Help] Upload file failed with invalid of file upload MimeType
See original GitHub issueI would like upload a media file such as image, audio file, etc… In postman, I can run the API to upload the file, the details in postman please check screenshots as below.
When I transfer postman’s request to karate feature, but fail. My feature file as below.
Feature: test
Background:
* url 'http://example.axm'
Scenario: upload file
Given path 'api/media/save'
And header Authorization = 'token'
And multipart field file = read('coverImage.png')
And multipart field Type = 'image'
When method post
Then status 200
error message
response: MimeType of file uploaded is Invalid.
could you advise how I can implement it by Karate for this upload file call?
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
[Help] Upload file failed with invalid of file upload MimeType
I would like upload a media file such as image, audio file, etc.. In postman, I can run the API to upload the...
Read more >"Invalid mime type detected." Error When Trying to Upload a ...
“Invalid mime type detected.” Error When Trying to Upload a PDF File in Joomla's Media Manager · Open the file media.php which is...
Read more >Uploading MP3 Error Upload failed: Invalid Mime Type
Why is it that I am getting an error: Upload failed: Invalid Mime Type when I upload an MP3 file? .mp3 is in...
Read more >Invalid MIME type when trying to upload PDF or DOC files
My file upload settings is set to allow all types of files for upload. I'm using freeform with the file upload feature and...
Read more >php file upload - invalid MIME type? - Stack Overflow
It checks the mime-type (should be audio file) and then uploads it. The type seems to be recognized but it gives an "invalid...
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 FreeTop 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
Top GitHub Comments
@ansonliao I agree that this will be convenient. but for now, I don’t want to maintain a huge list of all possible file-extensions and mappings to mime-types.
In addition to the doc, refer to the demo also: https://github.com/intuit/karate/blob/master/karate-demo/src/test/java/demo/upload/upload.feature
Try this.