Forum Discussion

AAB's avatar
AAB
Regular Contributor
4 years ago

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:

 

 

 

2) Then I tried according the documentation:

 

 

Like you see I'm getting an HTTP500

the Raw Request is slidely different though:

 

 

How can I solve this please?

 

Thanks in advance,

Kind regards,

AAB

 

 

  • nmrao's avatar
    nmrao
    Champion Level 3
    Is "$" missing below?
    >>file: "{pathDir}\\Share a document with ITP.docx"
    • AAB's avatar
      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's avatar
      AAB
      Regular Contributor

      nmrao I adapted the paths equally but no success:

       

      and the RAW request looks like this:

       

       thanks in advance,

      kind regards, 

      AAB

       

      • richie's avatar
        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