Re: Binary Files not saved with correct extensions

Dmitri T <[email protected]> Mon, 15 Jan 2024 09:31:26 +0100
Newsgroups gmane.comp.jakarta.jmeter.user
Message-ID <PH7PR12MB7139638C17F8AE0E68893396C06C2@PH7PR12MB7139.namprd12.prod.outlook.com>
Sunil Malgaya wrote:
> Dear JMeter Users,
>
> Seeking your assistance for the problem statement I have.
>
> I am actually trying to download the binaries (word, pdf, excel, pptx,
> docm, xlsm etc.) via an api and saving the response in the local folder.
> However, when I reviewed the saved binaries, except the pdfs all have
> extensions set  as
> "vnd.openxmlformats-officedocument.wordprocessingml.Document" for docx and
> docm; "vnd.openxmlformats-officedocument.presentationml.presentation" for
> pptx;
> "vnd.openxmlformats-officedocument.spreadsheetml.sheet" for excel and xlsm
>
> But for the pdf it shows up correctly.
>
> Any ideas on how to fix that in JMeter only? I tried passing the extensions
> as above in 'Content-Type' also but still no help. Just an additional
> point, when I run the same api via postman, I get the files with the right
> extensions; so not sure why JMeter behaves this way.
>
> Thanks in advance for your help.
>
Files are saved according to their MIME type 
<https://en.wikipedia.org/wiki/Media_type>, if you don't like to have 
the MIME type instead of extension - just tick *Don't add content type 
suffix* box in the Save Responses to a file 
<https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file> 
listener, then you will be able to set your own extension instead.

More information: JMeter Performance Testing: Upload & Download 
Scenarios <https://www.blazemeter.com/blog/jmeter-performance-testing>