I have searched the forums on this one and have not found an answer.
Does anyone know how I can open a text file on the hard disk of a users machine to allow the data to be uploaded to a database?
I have used the code with success on my installation of mysql, php4 and IIS but when I pup the php code on the web and try and run it I get the following error:
Warning: fopen("C:\data.txt","r") - No such file or directory in /files/home1/gs/txtconvertmy.php on line 62
Obviously there is some issue with gaining access to the users hd from the web but I can't figure it out!
Sample code which works on my local machine :-
$fname = urldecode($filename);
//Open text file
$fd = fopen ($fname, "r");
//If error on opening txt file
if (!$fd) {
echo('System encountered problems finding ' .
strtoupper($fname) . ' - please check and try
again!');
exit;
}
//Read data from text file
$textfilearray = fread ($fd, filesize($fname));
//Close text file
fclose ($fd);
I have been stuck on this one for a while now!
Please help