Post File To Executable

261 views Asked by At

So I'm building a connector-like program (the executable) as the backend of a website, the program is written in Visual Studio 2010 (.NET 4.0) using C#.

Basically, the frontend code will call the executable with parameters (or command line argument), then the program will calls different function and perform the appropriate operation.

Now I ran into an issue with uploading files. The website will ask the user to browse for a file, then hit the upload button. Once the upload button is hit, the website will call the executable. My idea is in the executable, somehow get the uploaded file and save a copy on the local server, then perform any modification on the local copy.

Hopefully I explained my case well enough. So my over all question is: Is there a way for my executable to basically get the the upload file?

I know there might be other work around such as sending POST request directly to a url, but that's not the case here. With the current setup of the website and the backend code, it is required that I use the standalone executable.

Any help is appreciated, thanks!

1

There are 1 answers

2
SLaks On BEST ANSWER

You can write the incoming file to the executable process' StandardInput.