title: How to access local drive's file from the server (www.domain.com)?
body: <p>Needed to access the local hard disk drive from the server.</p>
  
  <p>For example, one file name <code>ex.txt</code> is in D drive, by running the php script(named as:<code>run.php</code>) with <code>$file = fopen("D://ex.txt","r");</code> it will open the file in read mode.</p>
  
  <p>It doesn't show error when its run on local server i.e <code>(localhost/run.php)</code>, file opens since the file gets accessed. and now the thing is I need to access the same local disk when the same <code>(run.php)</code> script runs on the remote server.</p>
  
  <p>The script will be kept in <code>www.domain.com</code> i.e <code>(www.domain.com/run.php)</code>. Now after running <code>www.domain.com/run.php</code> it has to access the (local device sending the request) <code>D://ex.txt</code>.</p>
  
  <p>Since PHP is a server side, thought Javascript can be used to access the <code>D://ex.txt</code> andn then send to server to do so the url will be <code>//home/user/D/ex.txt</code>. But the file should be accessed from <code>www.domain.com//</code>. </p>
  
  <p>In what way this can be achieved. Tried in Google, after that only asking here. Any Info Plz,Thanks.</p>
  
  <p>Since <code>run.php</code> kept inside public_html of <code>www.domain.com</code>. So fopen function path will take default as <code>domain.com/public_html</code> as the root. but i dont have to upload the file or copy the file... just i have to read few lines from the text file in D://ex.txt..... like--> www.domain.com is my website... then whichever user example like YOU access www.domain.com/run.php then the contents of YOUR Computer's D Drive's ex.txt has to be read n to be sent to the server...!!
   I m Talking about the two way mechanism where the local machine and the server has to be matched prior.... ex) can Your local machine be configured like my server www.domain.com access your local disk ??.... if your local machine allows my server to read then its fine.. in else case error message is ok... Because thinking about the Pendrive authentication for the web application to run.... You have a pendrive where encrypted data is present.. If you loginto my domain.com then i ll check ur Pendrive data for the correct (matching encrypted)data and give you permission to login.. and on each page navigation i check the users pendrive for the data... If the user removes the pendrive My Application on www.domain.com should not allow you to access the application.. Sorry About this big post.. because this is my First Question in Stackoverflow.. Thanks :) </p>