sfmok / request-input-bundle

RequestInputBundle converts request data into DTO inputs objects with validation.
MIT License
37 stars 0 forks source link

`multipart/form-data` `boundary` property is not supported #14

Open Alexandre-Fernandez opened 1 year ago

Alexandre-Fernandez commented 1 year ago
The content-type "multipart/form-data; boundary=--------------------------580848852863824060235695" is not supported. 
Supported MIME types are "application/json", "application/x-json", "text/xml", "application/xml", "application/x-xml", "application/x-www-form-urlencoded", "multipart/form-data".

I get this error when trying to post a file with VSCode's thunder client.

image

This is the DTO :

final class FormDataDto implements InputInterface
{
    #[Assert\NotBlank]
    private string $id;

    private string $type; 

    #[Assert\File(
        maxSize: '5120k',
        extensions: ['pdf'],
        extensionsMessage: 'Please upload a valid PDF',
    )]
    private ?File $attachement = null;

    // getters and setters ...
}
sfmok commented 7 months ago

Thanks for reporting. Unfortunately, that content type is not supported yet due to file upload. Feel free to push a PR to support that type.