-2

I want to create a personal app by HTML & jQuery. This app is local base. But I have a big problem! "Not allowed to load local resource" on chrome.

I need to get real local file path on my computer from this form:

<img src="D:\images\demo\logo.png">
<form action="">
    <input type="file" name="myfile" id="file">
    <div onclick="check();">check</div>
</form>

For example I choose one image by this path: D:\images\demo\a.png but I can't get real local path by jQuery and ... .

I try this posts but not working for me for security reasons!

Milad Ghiravani
  • 1,625
  • 23
  • 43

1 Answers1

0

It's blocked for security reason so that we can't modify the local resource directly via WebApps.

What we have been using is "Web Server for Chrome". You start it up, choose the folder wishing to work with and go to URL (like 127.0.0.1:port you chose)

It is a simple server and cannot use PHP but for simple work, might be your solution:

https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb

  • Thanks, I use this but get `Not allowed to load local resource` error – Milad Ghiravani Jul 24 '19 at 11:10
  • I hope you would have followed the right procedure, still you can checkout the link below so as to track in case you missed something. https://medium.com/@jmatix/using-chrome-as-a-local-web-server-af04baffd581 – Vaibhav Kaushik Jul 24 '19 at 11:13