Ask a Question

ReadyAPI send binary file doesn't work

AAB
Regular Contributor

ReadyAPI send binary file doesn't work

Hi,

I've tried to add a fille to a POST Request but it seems that I have no luck. I've followed the information from the documentation but it still isn't working. 

What am I doing wrong?

For starters, this teststep was executed as a simple xml project, not a composite project.

1) the Requet should contain this:

file: ${#Project#pathDir}\Share a document with ITP.docx
fileName:Share a document with ITP.docx
themes:personal
tag:test cu to ITP
shareable:true

MediaType = mulitpart/form-data

Token of the user

2) when I send it like this I receive a "client.technical.malformed" error message. The Raw Request looks like this:

AAB_0-1633332199408.png

 

 

 

2) Then I tried according the documentation:

AAB_1-1633332334059.png

 

 

Like you see I'm getting an HTTP500

the Raw Request is slidely different though:

AAB_2-1633332412599.png

 

 

How can I solve this please?

 

Thanks in advance,

Kind regards,

AAB

 

 

5 REPLIES 5
nmrao
Champion Level 3

Is "$" missing below?
>>file: "{pathDir}\\Share a document with ITP.docx"


Regards,
Rao.
AAB
Regular Contributor

Hi @nmrao thanks for your response.

Well actually: no, I don't think so as I use the whole path there. should that be exactly as the path in the value? Is there a difference?

 

Kind regards,

AAB

AAB
Regular Contributor

@nmrao I adapted the paths equally but no success:

 

AAB_0-1631286694788.png

and the RAW request looks like this:

AAB_1-1631286789121.png

 

 thanks in advance,

kind regards, 

AAB

 

richie
Community Hero

Hey @AAB,

I had a lot of trouble using this multipart type when i last tried about 3 years ago,but i did get it working eventually (with forum help), so i'll dig through my posts to find an answer.

Btw. This will probably make no difference, but i always try and minimise any issues. I notice you have spaces in the name of your attachment file. I would remove these,or i would percent/html encode them as thefilename appears in your payload and HTTP requests require percent encoding for any special,non-alpha numeric chars. Just a suggestion,

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
AAB
Regular Contributor

Hi @richie Nice to read ya again! 🙂    Thanks, that would help because I'm still stuck.

And concerning the spaces in the name: I've tried another file that was concatenated without spaces in it but no luck neither.

Thanks for helping!

 

kind regards,

AAB

cancel
Showing results for 
Search instead for 
Did you mean: