Board index » Web Programming » How to RUN a fil from my website?

How to RUN a fil from my website?

Web Programming256
I have a file that is not typical. It is called "opend.smp". If the file

is located on the desktop and a user double-clicks it, a local proprietary

program is launched. How can I make this happen from my website? i have

the file "opend.smp" located on my website but it won't launch the local

program. How can I cause a local program to be launched? Do I need to

write an ActiveX control or something similar?


-
 

Re:How to RUN a fil from my website?

You may need to re-think this. Browsers are designed NOT to let this sort of

thing happen. Users don't want things automatically launching applications

or doing it without their consent. Things like a Word doc opening in the

browser are different because those are active documents that can be hosted

within the browser instance. If there is no file viewer associated that the

web browser knows of, the typical user expects to be asked to do something

with it. You may be able to do this by setting a MIME type on the server so

that the web browser gets information as to what type of file it is and a

may be able to determine what the appropriate viewer is for that file.



--

Hope this helps,

Mark Fitzpatrick

Microsoft FrontPage MVP 199?-2006. 2007 and beyond



"Tim McGavin" <nws@gsw-inc.com>wrote in message

Quote
I have a file that is not typical. It is called "opend.smp". If the file

is located on the desktop and a user double-clicks it, a local proprietary

program is launched. How can I make this happen from my website? i have

the file "opend.smp" located on my website but it won't launch the local

program. How can I cause a local program to be launched? Do I need to

write an ActiveX control or something similar?









-

Re:How to RUN a fil from my website?

"Tim McGavin" <nws@gsw-inc.com>wrote in message



Quote
I have a file that is not typical. It is called "opend.smp". If the file

is located on the desktop and a user double-clicks it, a local proprietary

program is launched. How can I make this happen from my website? i have

the file "opend.smp" located on my website but it won't launch the local

program. How can I cause a local program to be launched? Do I need to

write an ActiveX control or something similar?



You *might* be able to do this by specifying the "application/x-custom" MIME

type, though most ISPs will actively block this...

www.thescripts.com/forum/thread53317.html">www.thescripts.com/forum/thread53317.html



By far the simplest method is to provide a hyperlink to the file which the

user clicks and then saves to their desktop, from where they can launch

it...





--

Mark Rae

ASP.NET MVP

www.markrae.net">www.markrae.net



-

Re:How to RUN a fil from my website?

Quote
You may need to re-think this. Browsers are designed NOT to let this sort

of thing happen. Users don't want things automatically launching

applications or doing it without their consent.



Mark,



I don't need anything to happen without the users consent. Isn't there a

way to make this happen by installing something into the browser first? Do

I need to write some kind of tool-bar? Some kind of VB control? I have

seen things like this before but the only one that comes to mind is MS's

Windows Update

page. If I can find another example I'll post it.





-

Re:How to RUN a fil from my website?

Ok I found something that "kind of" works. If I put my proprietary file on

my FTP site and simply provide the user with a link to it, it does what I

want. It launches the local application for the file. But is there a way

to do this without using an FTP site?





-

Re:How to RUN a fil from my website?

"Tim McGavin" <nws@gsw-inc.com>wrote in message



Quote
Ok I found something that "kind of" works. If I put my proprietary file

on my FTP site and simply provide the user with a link to it, it does what

I want. It launches the local application for the file. But is there a

way to do this without using an FTP site?



Other than what Mark and I have already suggested, I don't think so...





--

Mark Rae

ASP.NET MVP

www.markrae.net">www.markrae.net



-

Re:How to RUN a fil from my website?

On Jul 14, 6:13 pm, "Tim McGavin" <n...@gsw-inc.com>wrote:

Quote
Ok I found something that "kind of" works. If I put my proprietary file on

my FTP site and simply provide the user with a link to it, it does what I

want. It launches the local application for the file. But is there a way

to do this without using an FTP site?



Force the browser to display the Open/Save dialog. Don't put the

direct link to the file, but set the Response object's ContentType

property to application/octet-stream and add an HTTP Request header

called Content-Disposition with the following value: attachment;

filename="filename" where filename will be the name of your file.



string filename = Path.GetFileName("/opend.smp");

Response.Clear();

Response.ContentType = "application/octet-stream";

Response.AddHeader("Content-Disposition", "attachment;

filename=""opend.smp""");

Response.Flush();

Response.WriteFile(filepath);



-