Skip to content Skip to sidebar Skip to footer

Avoid Activex To Save A File

There is a function that returns an array from a table: GetFilteredData: function() /*==================================================== - returns an array containin

Solution 1:

Why does this require elevated privileges?

JavaScript cannot natively access the filesystem directly. The ActiveXObject you are using allows for JS to do that. It makes sense, right? We wouldn't want a website to have write access to our filesystem, because malicious users could possibly destroy data or put malicious programs on our computer. It'd be a drive-by download from hell. Only the most trusted sites should have that kind of access (and arguably, no website should be doing things like that).

How do I get around this?

I think the best thing for you to do is create the filtered CSV server-side, and allow the user to download it directly from your server. If the user is supposed to put it somewhere specific, you could write instructions that they read before downloading it. (maybe http://ux.stackexchange.com could suggest a nice way of doing this)

Post a Comment for "Avoid Activex To Save A File"