<HTML> download .sql file

I am working on an angular app

I have this function

`

vm.DownloadFile = function (item) { var a = document.createElement('A'); a.href = item.fileSourceUrl; a.download = item.fileSourceUrl.substr(item.fileSourceUrl.lastIndexOf('/') + 1); document.body.appendChild(a); a.click(); document.body.removeChild(a); } 

`

This allows me to download files from my view using the url. It works fine, I can upload my files with this.

The problem I just noticed is that I cannot load .sql files. What for? Many file types work, .jpg , .pdf , .dwf ... everything except .sql

+5
source share
2 answers

I finally found what was wrong, the MIME type for .sql was not set in my IIS configuration.

+4
source

You need to set the MIME type for .sql files

To set the MIME type

Open IIS Manager In the Features view, double-click the MIME types. In the Actions panel, click Add. In the Add MIME Type dialog box, enter the file name extension in the File Name Extension text box. Type the MIME type in the text field of the MIME type. Click OK.
+2
source

Source: https://habr.com/ru/post/1269598/


All Articles