Javascript and Activex permissions on IIS

Asked

Viewed 197 times

2

Hello, an Asp.Net MVC application uses Scripting.Filesystemobject to create text files. On the development machine works normally, this application was published on an IIS server and also worked normally, but when I went to publish itwas on another IIS server it no longer generates the text files and when I put IE in debug mode to see why it shows error right in the javascript line wants to generate the file with the permission message denied.

The first IIS server I published and ran is one that already had other applications. net and the one that is not working is an IIS that was installed a little while ago, so if the other one was made some configuration this has no.

So my question is: do you need to make some configuration in IIS so that it is possible to generate text files by Javascript or to use Activex as Scripting.Filesystemobject?

  • Development machine is one thing, you have control over everything. You have to develop to work on machine that you can’t have everything wide open. And you can put whatever you want on the pages, it’s just a text, there’s no restriction. Whether it will work is another problem. It depends on what you did.

1 answer

0

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

After all, what do you really want? Create the text file on each client’s machine that accesses the site or on the server where the application is running (website) ?

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

If it’s in the customer’s machine, What would be the reason for this ? Because you will hardly succeed, imagine you are creating a TXT file, but if that were possible, anyone could create a file. BAT, . EXE, etc do the reverse way (access files) and steal files from local disk only by the person having accessed the site... If you really need to, you’ll need to convince (and teach) each user to free up Activex access on their PC, and as far as I know Activex only works on IE (I don’t even know if EDGE still has it) Another solution if you need to write on the user’s machine is to create an executable tool (.exe) or a browser extension (ai is one for each browser right) that does the job and this tool/extension communicates with your site (or not, if you don’t need to).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.