Ask a Question

attach multiple file into one property

msalvador
Frequent Contributor

attach multiple file into one property

Hi guys,

I'm trying to post multiple files that use the same property.

 

Property name is:"file"

Files to upload:"HP.png,HP1.png,etc..."

So file=>HP.png,HP1.png

 

For semplicity I post both postman screenshot(that works) and ReadyAPI screenshot(that don't works).

What I want to do is reply postman request into ReadyAPI

Any idea?

Thanks in advancepostman.pngreadyapi.pngpostman.pngpostman.png

10 REPLIES 10
richie
Community Hero

Hey @msalvador 

 

 Can you please reattach the screen grabs you embedded please?  They're tiny and I cant see them - even when I download them.

 

If you use the attach function rather than embed function - I find that helps with screengrab sizes sometimes

 

ta

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
msalvador
Frequent Contributor

postman.pngreadyapi.png

Hey @msalvador 

 

Im still unsure what you're after - but I think (considering the screenshot), you want to have multiple URI parms (either URI or query) with the identical names (but different values).

 

 

If my above guess IS correct, check out -->  https://community.smartbear.com/t5/ReadyAPI-Questions/how-to-pass-more-then-one-parameter-in-soapUI-...

 

This tells you how to do it and definitely works cos I've done it before myself!

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
msalvador
Frequent Contributor

Hi Richie,

thank you for the reply, I tried but without success.

Problem is on file parameter. Syntax for sending files is

 

Parameter            Value

file                         file:HP.png

 

I tried

Parameter            Value

file                         file:HP.png|file:HP1.png

 

Parameter            Value

file                         file:HP.png|HP1.png

 

but it doesn't work

Hey @msalvador 

 

what's the mediaType value you're setting?   What's the Content-Type header for your successful request in Postman?

 

I'm guessing that you need to set the MediaType combo box to either 'x-www-form-urlencoded' or the 'form-data' option to replicate the Content-Type header generated on the successful request in Postman

 

If my memory is correct - the  x-www-form-urlencoded doesnt work for files - I think - it's been quite a while since I attached a file.

 

So! - short answer  - "I think" again going on memory here, I think the value you need to stick on the MediaType combo is 'multipart/form-data' - if you've setup correctly then this should work.

 

cheers,

 

Rich

 

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
msalvador
Frequent Contributor

Hi Richie,

in postman is a form:data.

in ReadyAPI I set Mediatype= multipart/form-data

Hi @msalvador 

 

yeah - the radio button to set the type in Postman is entitled as 'form-data' - but if you look at the RAW details of the request - the Content-Type header will say 'multipart/form-data'

 

Thats what you need to populate the MediaType dropdown with

 

If you're still struggling - once I've finished work, I'll setup a VIRT to match your URI string and set it up in ReadyAPI and screenshot it so you know what I did.

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
msalvador
Frequent Contributor

AuthorizationBasic Q1BEVEhQODdBMDFJNzI1UDo2NzQ0NTYwMw==
User-AgentPostmanRuntime/7.28.4
Accept*/*
Postman-Token3741f70b-d8c2-4d40-9339-de2df80304b3
Hostxx.xx.it
Accept-Encodinggzip, deflate, br
Connectionkeep-alive
Content-Typemultipart/form-data; boundary=--------------------------461373579186026720762425
Content-Length818365

Hey @msalvador 

 

yep - as you can from the RAW details of the Postman request - your Content-Type header is set to 'multipart/form-data'.

 

So - if you set the MediaType combo to 'multipart/form-data' that should sort things

 

Cheers,

 

Rich

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
cancel
Showing results for 
Search instead for 
Did you mean: