You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, at some point we might want to replace the existing uploaded file with a new file. This is most likely done with a PATCH i.e. define this operation (same as with the POST):
However, there's no way I can see in the $request to get the values out of the transmitted data, i.e. both $request->request->all() and $request->files->all() are null.
You can also use the POST method to upload files to the server.
BurningDog
changed the title
MultipartDecoder only works on POST not PATCH
MultipartDecoder requires PECL extension to update file on existing resource
Sep 10, 2024
The context of using
MultipartDecoder
is when we are Uploading to an Existing Resource with its Fields.MultipartDecoder
works as expected when an API POST is done and a new resource is created.However, at some point we might want to replace the existing uploaded file with a new file. This is most likely done with a PATCH i.e. define this operation (same as with the POST):
However, there's no way I can see in the
$request
to get the values out of the transmitted data, i.e. both$request->request->all()
and$request->files->all()
arenull
.The curl looks like so:
I assume that it's not possible to PATCH
multipart/form-data
, but then this means that we can never update an image via the API.What do we do instead in this case?
The text was updated successfully, but these errors were encountered: