0

I'm using POSTMAN, and I'm trying to send an file using PUT Method. Is it correct to send it using the x-www-form-urlencoded option?

Also, I can't select the FILE field option. How can I do this? I'm trying to edit an user image.

Pika Supports Ukraine
  • 3,612
  • 10
  • 26
  • 42
Hermus
  • 193
  • 2
  • 11
  • 3
    Hi Hermus, and welcome to Stack Overflow! When asking a question about a problem caused by your code, you will get much better answers if you provide code people can use to reproduce the problem. Consider including an example of the request that are you trying. See: [How to create a Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve). Good luck! – Eduardo Baitello Apr 09 '19 at 01:15
  • @Hermus fyi the answer is a duplicate of [this answer](https://stackoverflow.com/a/46282610/8566549) – Hasta Dhana Aug 27 '19 at 05:05

1 Answers1

2

While using Postman especially when you test file upload please ensure that,

in Headers:

The Content-type field has been set as multipart/form-data in Headers.

in Body:

form-data option should be remain as default.
Choose File option instead of text from dropdown at the right side.
Type File in text box where placeholder is key.

Hope this helps!

Follow below screen short :

enter image description here

enter image description here

Mayur Kukadiya
  • 2,461
  • 1
  • 25
  • 58