0
<tr ng-repeat="transaction in transactionDetails">
                <td>{{ transaction.FromParty }}</td>
                <td>{{ transaction.CreatedState}}</td>
                <td><a href="file:///home/moulali/Desktop/samp_cc.go">Open File</a></td>
                <td>{{ transaction.Status }}</td>
            </tr>

I'm trying to open local file from html hyper-link in ubuntu os. But it is not opening and in f12 console log it is showing "Not allowed to load local resource:". I want to open a local file when i click hyper link.

  • 4
    Possible duplicate of ["Not allowed to load local resource: file:///C:....jpg" Java EE Tomcat](https://stackoverflow.com/questions/23969953/not-allowed-to-load-local-resource-file-c-jpg-java-ee-tomcat) – S.V. Sep 14 '17 at 10:23
  • you need the file in a webserver (wamp or iis etc) and then try to access that url. [example: localhost:4200/home/moulali/Desktop/samp_cc.go] – lpradhap Sep 14 '17 at 10:29
  • @lpradhap Can you explain in detail – rajasekhar pippalla Sep 14 '17 at 10:40
  • @DrSatan1 Doen't solved for my question I'm running on ubuntu machine then you marked my question as ubuntu – rajasekhar pippalla Sep 14 '17 at 10:43
  • if you want to access a file, then the file should be hosted inside a webserver, you cannot load files from your drive directly, you need host them in a webserver. if your not clear, please try to copy the file and try to include into asset folder in your angular project and then your the url/asset/filename. – lpradhap Sep 14 '17 at 10:43
  • @DrSatan1 Explain me how it is duplicate? – rajasekhar pippalla Sep 14 '17 at 10:53
  • Possible duplicate of [Open local files(file://) using Chrome](https://stackoverflow.com/questions/28724751/open-local-filesfile-using-chrome) – stiebrs Sep 14 '17 at 12:05

1 Answers1

0

Modern browsers explicitly forbid such actions, because this would allow websites to steal your personal data. Say, if browser is open under root account, then what would prevent website from downloading or even updating your /etc/passwd file? Or any other for that matter?

stiebrs
  • 379
  • 3
  • 13
  • Atleast is it possible to download local file – rajasekhar pippalla Sep 15 '17 at 06:12
  • What do you mean by "download local file"? It's already there, no need to download it. You just can't open it due to sandboxing. If you really want to provide scripts to user, you have to serve them from your server. – stiebrs Sep 18 '17 at 06:48