-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Closed
Labels
Description
Description
It would be very nice if MapRequestPayload
also supported UploadedFile
fields. Currently I haven't found absolutely any documentation stating that it does.
Example
readonly class UploadImageDTO
{
public function __construct(
public string $title,
public string $description,
// Add assertions about mime type and size, if possible.
public UploadedFile $file,
) {}
}
class SomeController
{
public function uploadImage(
#[MapRequestPayload] UploadImageDTO $requestData
): Response
{
// $requestData->file is guaranteed to be an UploadedFile
}
}
rguerrier-ras, cheike569, flomSStaar and D3lph1