It is a bit confusing to explain what I need, but I will try....
In the image below the browse button selects a file and the Upload button sends the file in a post method, but in some cases I need to process the file changing it to adapt for my importation, so I have created the "Convert file option".
The convert file option changes a file and sends it back to the user by downloading it again, then the user will import this file through my Upload button.
I need to get this FileContentResult not as a download, but sending this processed file through my other POST method and upload this automatically.
How can I get the File result and send it straight to my other POST?
I know that it is a completly weird behaviour, but I cannot change my Upload method as this redirects to another application which gets the post.
public FileContentResult ConvertFile()
{
var file = Request.Files[0];
if (file != null && file.ContentLength > 0)
{
/// my code... memorystream..etc..
return new FileContentResult(memoryStream.ToArray(), "text/csv") { FileDownloadName = "abc.csv" };
}
}