JavaScript and ActiveX Permissions in IIS

2

Hello, an application in Asp.Net MVC uses Scripting.FileSystemObject to create text files. On the development machine it works normally, this application was published on a server with IIS and also worked normally, but when I was publishing it on another IIS server it no longer generates the text files and when I put IE in debug mode to see the because it shows error well in the javascript line either it generates the file with the permission message denied.

The first IIS server I posted and ran is one that already had other .net applications and this one that is not working is an IIS that was installed shortly, so if the other was made some configuration this does not have

So my question is: do you need to do some configuration in IIS so that it is possible to generate text files by JavaScript or to use ActiveX as Scripting.FileSystemObject?

    
asked by anonymous 31.07.2015 / 21:25

1 answer

0

This has nothing to do with IIS or with Asp.NET, Javascript is client-side (we will not go into the merits of Node.js, which is server-side Javascript because it is not in the context of question) and so when using the ActiveX in question it needs permission from the machine where you want to create the file, which is what you described on the client machine (who accesses the site).

After all what do you really want? Create the text file on the machine of each client that accesses the site or on the server where the application is running?

If it's on the server , you have to do this in your controller (not in the view, good for the view, but for design reasons do not do it in the view) using System.IO. * (more precisely System.IO.File. *)

If it's on the client machine , what would be the reason for this? Because you will hardly succeed, imagine that you are creating a TXT file, but if that were possible, anyone could create a .BAT file, .EXE, etc. do the reverse path (access files) and steal files from the local disk only by person have accessed the site ... If it's really accurate, you'll need to convince (and teach) every user to free ActiveX access on his PC, and as far as I know ActiveX only works in IE (I do not even know if EDGE still exists) Another solution in case you need to write on the user's machine is to create an executable tool (.exe) or a browser extension (there is one for each browser) that does the task and this tool / extension communicates with your site (or not, if not required).

    
14.01.2017 / 21:47