I'm implementing stripe in my action ChargeFileUpload, on it should return to another action and upload said file.
Note these are not real class names, its just for the purpose of explanation.
public async Task<IActionResult> ChargeFileUpload(ProfileViewModel model)
{
user = await userManager.GetUserAsync(User);
string successUrl = $"{Request.Scheme}://{Request.Host.Value}" + Url.Action("UploadFile", "Member", new { model.Obj });
Session session;
... extra code..
}
Heres the thing, the ProfileViewModel contains an class which contains a file lets call the class it ClassWhichContainsFile and the object for that class obj.
On success of the payment, it goes to this method:
public async Task<IActionResult> UploadFile(ClassWhichContainsFile obj)
{
ApplicationUser user = await userManager.GetUserAsync(User);
if (user != null)
{
//add file to users account
}
return RedirectToAction("Profile", new { userName = user.UserName });
}
The issue I'm facing is that whenever I pass the obj to the UploadFile method, all the properties that I want are there, but the IFormFile is not. When I am in the ChargeFileUpload method the IFormFile is there.
How can I get my IFormFile to be passed to the UploadFile method correctly?