c# - Send a file in a POST coming from the return of a MVC Method -


it bit confusing explain need, try....

in image below browse button selects file , upload button sends file in post method, in cases need process file changing adapt importation, have created "convert file option".

enter image description here

the convert file option changes file , sends user downloading again, user import file through upload button.

i need filecontentresult not download, sending processed file through other post method , upload automatically.

how can file result , send straight other post?

i know completly weird behaviour, cannot change upload method redirects application gets post.

public filecontentresult convertfile() {     var file = request.files[0];     if (file != null && file.contentlength > 0)     {         /// code... memorystream..etc..         return new filecontentresult(memorystream.toarray(), "text/csv") { filedownloadname = "abc.csv" };     } } 

see post hope you.

also, see msdn sample click here

you can use third party libraries deal these problems restsharp etc., show efforts.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -