Forum Discussion

Shashavali's avatar
Shashavali
Contributor
7 years ago

how upload a .CSV file for a upload endpoint

Hi , In my current project there is an endpoint /upload. In this endpoint i have upload a .csv file along with some other parameters. I tried in postman and able to create the response and got successful response. I am trying to do the same in Ready API (SoapUI Pro). As i am new to it, i don't have much knowledge about it. It will be a great help if someone can guide me.

 

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You need to use right Media-Type in the request.
    • Shashavali's avatar
      Shashavali
      Contributor

      nmrao - Thank you very much for the reply.

       

      After discussing with dev team, i got to know that i have to use Media Type as 'multipart/form-data'. 

       

      It will be a great help if you share an example how to write body data dynamically of multipart/form-data.

       

      Below is the payload which i can see in chrome console

       

      ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2
      Content-Disposition: form-data; name="fileType"
      
      DCA_FILE
      ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2
      Content-Disposition: form-data; name="DCA_FILE"; filename="Orion DCA.csv"
      Content-Type: application/vnd.ms-excel
      
      
      ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2
      Content-Disposition: form-data; name="projectId"
      
      5a3aa07d8058f37f26f10831
      ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2
      Content-Disposition: form-data; name="columnMapTemplate"
      
      {"mappings":{"make":"deviceType":"","hasColor":"","location":"","country":"","site":"","building":"","floor":"","subEnvId":"","stapleTotalLastReading":"","notes":""},"name":"defaultTemplate"}
      ------WebKitFormBoundaryx5wcwgn0MRYwf1Z2--

       

      Thanks a lot in advance.