Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

open a file with its default programme

In my application I want to open some files with the correct default programmes, like .doc file should be open with WORD and .psd files should be opened with Photoshop if it is installed, and this should be done under html or java script.

Please tell me how to do it.

like image 498
Abhishek Avatar asked Aug 28 '26 00:08

Abhishek


2 Answers

There is no way for you to choose which application will be used to open your files with javascript...It just doesn't have that power.

like image 158
peirix Avatar answered Aug 30 '26 13:08

peirix


Browsers typically don't have access to the computer's filesystem for security reasons. If you know the exact path to a file you can point the browser at it using a file: URI, e.g.

file:///C:/path/to/file.ext

You may also be able to do this with a plugin, eg ActiveX, however I am unsure as to what security measures that would have.

like image 29
Tullo_x86 Avatar answered Aug 30 '26 13:08

Tullo_x86



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!