#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    15
    Rep Power
    0

    Local File Access


    Ok, being a web develper i know that this isnt generally acceptable, and rightly so for many reasons.

    But at the moment i am toying with an idea and i basically i want to have a page where when loaded by a client, it (by either asking and getting permission, because the client will WANT to give permission) look for a specific directory on the users computer and read a file within, no writing, no modifying, just read a file.

    Ive read recently that HTML5 gives local file storage/access but from what i have read this allocates you space on the HD to store and read files you have put there, so not access to the client directories.

    Like i said, i can fully see the reason for not, but the client will want to give permission, so even if there is a promt that is fine.

    Even if it required the user to download "somthing" to allow access or to be the middle man, what is that something, generally?

    Thanks
    Andy
  2. #2
  3. A Not To Shabby Code Smurf
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Aug 2008
    Posts
    1,165
    Rep Power
    184
    I think this will be about as close as you can get; because of browser security.

    http://www.html5rocks.com/en/tutorials/file/dndfiles/
  4. #3
  5. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    From standard JavaScript there is no way to even prompt for that sort of access.

    However, the "something" they have to download could be a standard browser plugin (Flash/Java/Silverlight/ActiveX) or it could be a custom browser plugin. Plugins can run with higher permissions than in-page JavaScript, and therefore have the capability to do the sort of thing you're asking about.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo