0

I hope you can help me.

I am writing a desktop program that will run in a web browser (in HTML/CSS/javascript in case that wasn't clear). It will be entirely disconnected from the internet and obtain files and data using only FILE protocol. My question is: how can you obtain a listing of the contents of a directory referenced this way?

I've been searching for months and really turned up almost nothing! Maybe I just don't know how to search but there doesn't seem to be much information about how browsers actually deal with File protocol.

For example, when you open a directory in Chrome, it gives you a nice table with hyperlinks of all the parent directory's children. However, when you look at the source code, it's as if Chrome just magically knew exactly what files were in the directory. I feel that if I could understand how it knew that, maybe I'd be able to get somewhere...

Also, I am open to other ideas about how to get a directory listing. I've read about being able to do it with php but it requires running a server. Does anyone know if it is possible to run php code with File protocol rather than HTTP?

Thanks for reading this far and truely any information that could remove me from this standstill is appreciated!

G-Cam
  • 261
  • 3
  • 12

1 Answers1

1

Web Apps do not have access to the user's file system so you will not be able to do what the chrome file browser does with a web app. I believe chrome is using some sort of native code to do this.

I would recommend trying something a little more on the native-side. A chrome app will let you use html, css, javascript while also allowing you access to the file system. https://developer.chrome.com/apps/app_storage#filesystem

Another alternative is you could write some sort of native java application. That would allow you to read/write all the files you want.

dreyguy
  • 26
  • 1
  • Thank you very much. I never would have thought of making a chrome app. I'll look into it. – G-Cam Sep 20 '14 at 03:51