Reputation: 2163
I have an API endpoint that accepts multipart/form-data
file upload. I managed to upload a local file to it with Postman using the File
option as below:
Now how can I upload a file that is hosted at a given URL using Postman without manually downloading it and then selecting its filename as in the above screenshot? I'm hoping to somehow GET
the URL, store the binary data, and upload to the endpoint, all within a Postman collection.
Upvotes: 3
Views: 1384
Reputation: 81
One of the answers from Postman community issue:
Using Postman’s pre-request script:
- Download the content from URL
- Convert it to binary
- Assign the binary value to a dynamic variable
- Use the variable within your request
Upvotes: 1