Skip to content

Instantly share code, notes, and snippets.

@bnchdrff
bnchdrff / README.md
Created July 21, 2016 13:30
Add POST endpoint for performant Drupal 8 REST file uploads

Instead of accepting serialized files, I wanted to process file uploads as multipart/form-data.

I also wanted to use the crsf prevention API.

This is what I came up with. Replace modulename with your module and fileupload with whatever you want to name your class/endpoint.

In your routing.yml: