Code:
$fileContent = file_get_contents('upload/'.$assId.'/'.$matric.'.cpp');
file_put_contents('filename.txt',$fileContent);
I'm using windows (so no issues regarding permissions I guess), and I am issuing ajax call to this php script which will read the file and return back json encode contents of the file so I can display it from calling php script.
So are there any secret tips and tricks in reading files from sub-directories? I also tried absolute path with dirname(__FILE_ _) then append /upload/ that did not work as well.
Comment