RnD-PUCIT / CodeFreak

0 stars 0 forks source link

Upload/Send Files with data in FormData to .net core api - Add Problem - Event Management #123

Closed muhammadusmansaleem closed 5 years ago

muhammadusmansaleem commented 5 years ago

I design sub block in add problem component for the input output files where you have to provide files. I successfully design that page. Now I want to send files server side but I failed.

muhammadusmansaleem commented 5 years ago

I'm sending files and problem related data in FormData but I can not get that data at server side (asp.net core 2.1 web api). I tried many links to find out that what is problem? why I am not getting data at server side? But I failed.

muhammadusmansaleem commented 5 years ago

@arslanaslam007 is also facing same problem. He alson want to send file to server for profile management module.

muhammadusmansaleem commented 5 years ago

I did not get solution since 2-3 days struggle. I search out that there is some header problem. Now I'm changing header randomly and try to get data. I get info about header form following link. https://stackoverflow.com/questions/44097604/file-upload-using-asp-net-core-web-api-file-is-always-null.

muhammadusmansaleem commented 5 years ago

I tried to follow this link https://stackoverflow.com/questions/44097604/file-upload-using-asp-net-core-web-api-file-is-always-null And I did not pass 'Content-Type' value in header and I successfully get files and data from Request.Form.

muhammadusmansaleem commented 5 years ago

Successfully solve the files upload isuue.