eidellev / inertiajs-adonisjs

279 stars 17 forks source link

getting null on the controller endpoint wile uploading a file #53

Closed dmostafiz closed 2 years ago

dmostafiz commented 2 years ago

I am sorry for re open the same issue. actully I am doing same what you suggested previously. just one different thing is i am not using typeScript in react.

The Problem is still i am getting null in the controller endpoint. i am selecting valid image file. and when submit it console shows that the value of the file is null.

Repo: https://github.com/dmostafiz/adonartia

React Component

Screenshot 2022-02-19 230618

Controller

Screenshot 2022-02-19 230719

Console log

Screenshot 2022-02-19 230536

and getting this error in the browser console

Screenshot 2022-02-19 231829

eidellev commented 2 years ago

The error you're seeing in the browser is because you're not sending a proper response from the backend. Can you please check your request in the network tab and see that it's a multipart/form-data request and that it has the file?

dmostafiz commented 2 years ago

Thanks for your answer, i am checking and update you soon.

eidellev commented 2 years ago

Closing this for now. Feel free to reopen if you have any additional problems.