8000 Question: How to handle multipart/form-data · Issue #349 · cloudcreativity/laravel-json-api · GitHub
[go: up one dir, main page]

Skip to content
Question: How to handle multipart/form-data #349
Closed
@lucianholt97

Description

@lucianholt97

I am trying to upload an image using the JSON API.
I already added the ContentNegotiator resource-specific to the images resource.
I followed the docs and added this code in order to accept multipart/form-data headers:

protected $decoding = [
        'multipart/form-data' => \App\JsonApi\MultipartDecoder::class,
        'multipart/form-data; boundary=*' => \App\JsonApi\MultipartDecoder::class,
    ];

At this point I am struggling to find or provide the MultipartDecoder class.
Can you explain to me, what I need to do next and how I can retrieve the uploaded file in the controller?

Thank's in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0