开发者

Force Download on client machine

One of my requirements is, on load of page, a file is to be created dynamically and downloaded at a particular location on the client's machine. In case the file is already present, it has to be over written.

is there any way where we can access the client's system and store the file at the r开发者_StackOverflowequired folder? I feel one cannot access the client machine when the code is being executed on the server..

Senorio: 1-User click on generate document then it took template stream data ,req. data file and then save two file into client machine. 2-After that template open and it fetch the data file from same directory.

Please help me on this. This is an SOS!!


There are probably other solutions, I use a signed applet for this purpose.

As always, there are a few caveats though:

You can't "force" anything against the will of the user. Applets may be disabled in the client's browser, or they may not even have Java installed. Or the target directory might not be writeable by the user.Your server should handle cases where the client doesn't have the correct version of the file gracefully.


You can't do this from the server side obviously but you also really can't do this from a client script either. Browser security will prevent a page script from modifying contents of the file system.

Your only options will be to run a third-party browser plugin software that has elevated permissions.

Examples of such are

  • Java Applets
  • Java WebStart
  • Microsoft Silverlight
  • ActiveX

Each one is different and most require some level of user interaction to confirm that they allow plugins to run with elevated security.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜