开发者

Open online file with desktop applications? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

I want to let the user click on a file (let's say a .doc link) in the browser and it will open the native desktop application (microsoft word in this case).

And when the user saves the document it will be saved in the web.

Is there a way doing this with Javascript/HTML 5 or does the user have to download the file to be able to open it with the native app开发者_C百科lication?


If you provide a link to this file on your page:

<a href="http://example.com/foo.doc">Open foo.doc</a>

it will be opened with the default application associated with this extension on the user computer.

If you want it to open inline inside the browser without any popup dialogs you could try setting the Content-Disposition HTTP header on the server: Content-Disposition: inline;filename=foo.txt. Of course the client application must have a plugin version which works with the browser and is capable of opening files inline (this is the case for example with Adobe Acrobat Reader).

As far as the second part of your question is concerned, there's absolutely nothing in the HTTP protocol specification allowing you to do this, so in order to achieve it it needs to be something custom-made. The client program needs to be able to talk to the server and send the modified version of the file back.


It is not possible to save back to your site unless the client application specifically supports it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜