You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sunil Malgaya <su...@gmail.com> on 2024/01/13 23:29:54 UTC

Binary Files not saved with correct extensions

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.

Re: Binary Files not saved with correct extensions

Posted by Dmitri T <gl...@live.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>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org


Re: Binary Files not saved with correct extensions

Posted by Aditya Singh <at...@gmail.com>.
Hi Sunil,
Did you try changing the extension and then open that file again?
Is there any difference in the content despite the extension difference?
Did you also check the request headers that’s going in postman similar to
that in JMeter?


Regards
Aditya

On Sun, 14 Jan 2024 at 5:00 AM, Sunil Malgaya <su...@gmail.com>
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.
>