I want to send an image file using REST API in Drupal 8 along with a registration form. I have built a custom API to save the registration form.

For the files I have created another API to save data using HEADERS Content-Type: multipart/form-data and update the registration form with file ID after saving it.

When I send the file using the POSTMAN Chrome extension to check the API, I don't get the file data in $request->files->get('image_name') in my Controller. What may be the reason?


As I know, right now it's not possible. You can upload files as base_64. Discussion is here https://www.drupal.org/node/1927648

| improve this answer | |
  • Hey Eugene, link-only answers are discouraged. What if the link becomes invalid? Please try to summarize the content the link provides to make this a long-lasting and comprehensive answer :) – leymannx Aug 28 '18 at 6:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.