eKelvin
eKelvin

Reputation: 923

saving a text file in client side without asking for permission any time

I need to save a text file on the client side possibly without permission. The case is that I need to save this text file in a shared folder in this or in another machine in the lan. This text file is going to be read automatically by the fiscal printer which will print the fiscal invoice. I have a asp .net web application and the server is not on the same lan with the fiscal printer, so I have to write it on the client-side. Any idea how to do this without asking to the user every time for the security issue. I need a cross browser solution.

I can accept a solution like, the client is asked only one time a the first printing, but not every time he wants to print a bill. Some kind of asking permission to the client for allowing this website, in order to not repeat the permission asking.

Upvotes: 1

Views: 2446

Answers (4)

MAW74656
MAW74656

Reputation: 3549

You could use a cookie, which won't ask permission. Of course that would only work when cookies are enabled and can store limited amounts of data.

Upvotes: 0

user153923
user153923

Reputation:

No, you can not do this. Saving a file to a computer without permission in a public folder is not allowed.

You can, however, have your Client install your application which will have the ability to read and write where you want.

A common way that Trojan viruses to this is by giving the Client some goofy program to run that displays a fireworks show or something else quite trivial. While the Client is busy wondering what he's looking at, your virus is installing quietly in the background.

Now, you are probably saying to yourself, "But I am not installing a virus." However, there is no way for a Browser to know if your application is a virus or not. That is why it is not allowed and why you can not do it.

Upvotes: 2

Mohammed Swillam
Mohammed Swillam

Reputation: 9242

The more applicable scenario for me is:

1- Do your work inside your web application.

2- Get the information that you need to print.

3- Send it to another computer directly (or to a hosted web service) and this computer will act as a host for these files.

4- let your server access this shared folder, and print what you want

Upvotes: 0

DNR
DNR

Reputation: 986

Obviously - this would be a major security breach to download files to the user's computer without them knowing. All browsers have precautions in place to prevent this from happening.

Upvotes: 4

Related Questions