dcsimg
Send parameters thru servlet. Read it from a client exe.
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   s_d
Posted On:   Tuesday, January 18, 2005 11:17 AM

Hi, I am launching an exe on client side based on mime-type. How do I pass params to this launched program (MFC-based)? This is similar to reading a pdf document. On click, acrobat.exe is launched and streamed data is displayed. I am able to launch the program but not able to read parameters passed. Here is how I pass params. resp.setHeader("Content-disposition", "attachment; filename=" + "Example.opti" ); byte[] buff = new byte[2048]; String str = "name1=value1,name2=value2,name3=value3,name4=value4"; buff = str.getBytes(); bos.write(buff); Q: How can I read buff from an c++ exe launched by Servlet?    More>>

Hi,
I am launching an exe on client side based on mime-type.
How do I pass params to this launched program (MFC-based)?

This is similar to reading a pdf document. On click, acrobat.exe is launched and streamed data is displayed.

I am able to launch the program but not able to read parameters passed. Here is how I pass params.


resp.setHeader("Content-disposition", "attachment; filename=" + "Example.opti" );

byte[] buff = new byte[2048];
String str = "name1=value1,name2=value2,name3=value3,name4=value4";
buff = str.getBytes();
bos.write(buff);



Q: How can I read buff from an c++ exe launched by Servlet?

Thanks
D.    <<Less

Re: Send parameters thru servlet. Read it from a client exe.

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, January 29, 2005 08:18 AM

Normally an application reads input streams like stdin, but also has access to the parameters you can put on the "command line" e.g. argv. But with an application invoked via a mime type from the web, I don't know how you would alter the argv.






You are apparently trying to write parameters to the response, but that is just going to become the content of the document that the application will read as its input. Like the previous reply said, the browser will save the response in the cache and then call your application on that cached document, so your parameters will be in the first few bytes of the document.


So if you design your application so it can get parameters from the first few bytes of its input, you could do it the way you are doing it.

Re: Send parameters thru servlet. Read it from a client exe.

Posted By:   Esteve_Olm  
Posted On:   Friday, January 28, 2005 03:41 AM

Reading a PDF document means that the server sends to browser PDF Data.


The browser download this PDF data and saves a copy in your cache directory


Then the browser finds a program (Adobe Acrobat Reader) and launches it with a link to saved cache file.


The program reads the file normally as if it was in your filesystem.

About | Sitemap | Contact