Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alihoushyaripour's avatar

How to handle received file and json data together?

Hi,

My client(android) call a route with post that handle this with multipart library to send a request to server.

In this route need to upload image inside of json data(image and json together)

When I read Request or request()->all() or $_REQUEST I can see json parameters, but when I read File or $_FILE, I see binary data(just 0,1 and not file parameters)

What should I do? I don't like to read image as code and encode it again, I want to get file as file.

0 likes
1 reply
tykus's avatar
tykus
Best Answer
Level 104

upload image inside of json

There is a good article on your options here

Please or to participate in this conversation.