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

adhik13th's avatar

@SIANGBOON - how to extract this $data on my controller ? my image saved in $data and different json saved at $request

adhik13th's avatar

@SNAPEY - emm i think i save json because i can decode it with any item on colomn 'pertanyaan'

u know sir , if i not use enctype="multipart/form-data" this image can saved on db like this "image":"img.jpg" (i want this) BUT not saved at directory

if i using enctype="multipart/form-data" , this image saved on directory but in database just like this "image":{}

Snapey's avatar

you always have to use multipart/form-data if you want image content to be sent to the server.

You are saving the image in a new location but not remembering where you put it

Previous

Please or to participate in this conversation.