Click to See Complete Forum and Search --> : Calling an executable file from ASP.NET


kwilliams
06-08-2006, 11:43 AM
I'm developing my site with ASP.NET with the use of Web Matrix/Notepad. I'm using VB syntax. We would like to call an executable file on a webpage for an on-the-fly photo.

Basically, we have photo paths stored in our DB table, and the actual photos are stored outside of a database. We currently have an executable job that optimizes the photo, and adds a label before it's viewed by the user. This is currently all done in ASP statically.

But we'd like to create a function that will do the following:
1) Pull the path from the DB
2) Save that photo to a temp folder
3) Run an executable file against that photo
4) Display the optimized photo for the user online

We have everything set up except for the calling of the executable file. So how can I call an executable file from a function within ASP.NET? And how could I then call that function from the actual web page display? Any and all help would be great. Thanks.

AlecW
06-14-2006, 04:22 PM
There is no need to call an executable to accomplish this. There are several things you can do to accomplish this without sacrificing the security of your application by calling an exe. One such way would be to use httphandlers to process the image (resize, watermark, etc..) and then serve it up to the page. You can also use another page to process the image and display the properly optimized image.

There are a few good articles on The Code Project (http://www.codeproject.com) that can help you with HTTPHandlers and watermarking.

I'm developing my site with ASP.NET with the use of Web Matrix/Notepad. I'm using VB syntax. We would like to call an executable file on a webpage for an on-the-fly photo.

Basically, we have photo paths stored in our DB table, and the actual photos are stored outside of a database. We currently have an executable job that optimizes the photo, and adds a label before it's viewed by the user. This is currently all done in ASP statically.

But we'd like to create a function that will do the following:
1) Pull the path from the DB
2) Save that photo to a temp folder
3) Run an executable file against that photo
4) Display the optimized photo for the user online

We have everything set up except for the calling of the executable file. So how can I call an executable file from a function within ASP.NET? And how could I then call that function from the actual web page display? Any and all help would be great. Thanks.

kwilliams
06-14-2006, 04:25 PM
Hello AlecW,

I had almost given up home in receiving a response to this thread. I really appreciate your advice, and I'll definitely apply it to our problem. Thanks for the heads-up...it's really appreciated.