Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome & Safari Error::Not allowed to load local resource: file:///D:/CSS/Style.css

When I access my aspx page in chrome or safari it shows this error in console

Not allowed to load local resource: file:///D:/CSS/Style.css

Everything works fine in IE and FF.

I use an external CSS which is linked in aspx page via

<link rel="stylesheet" media="all" href="file:///D:/CSS/Style.css" type="text/css" /> 

I have tried all the combination of "/" & "\" slashes..

Whether I am giving file path in wrong manner or its any security exception in these browsers(I am logged in as administrator)... What am I doing wrong?

like image 978
Maybe2013 Avatar asked Feb 22 '11 06:02

Maybe2013


People also ask

How do I open up Chrome?

Accessing Chrome Whenever you want to open Chrome, just double-click the icon. You can also access it from the Start menu or pin it to the taskbar. If you are using a Mac, you can open Chrome from Launchpad. You can also drag Chrome to the Dock for fast access.

What is the Chrome browser?

Google Chrome browser is an open source program for accessing the World Wide Web and running Web-based applications. The Google Chrome Web browser is based on the open source Chromium project.

Why can't I install extensions on Chrome?

Make sure you have the latest version of Chrome. Learn how to update Chrome. If you're using a work or school computer, your administrator might not let you install items from the Chrome Web Store. For more help, contact your administrator.

What is the difference between Chrome and browser?

Chromium is an open-source and free web browser that is managed by the Chromium Project. In comparison, Google Chrome is a proprietary browser developed and managed by Google. Unlike Chromium, Google Chrome offers built-in support for media codecs like MP3, H. 264, and AAC, as well as Adobe Flash.


2 Answers

You wont be able to access a local resource from your aspx page (web server). Have you tried a relative path from your aspx page to your css file like so...

<link rel="stylesheet" media="all" href="/CSS/Style.css" type="text/css" /> 

The above assumes that you have a folder called CSS in the root of your website like this:

http://www.website.com/CSS/Style.css 
like image 134
curv Avatar answered Oct 07 '22 01:10

curv


It is today possible to configure Safari to access local files.

  • By default Safari doesn't allow access to local files.
  • To enable this option: First you need to enable the develop menu.
  • Click on the Develop menu Select Disable Local File Restrictions.

Source: http://ccm.net/faq/36342-safari-how-to-enable-local-file-access

like image 41
John Avatar answered Oct 06 '22 23:10

John