I had file upload input type in page 1:
<form enctype="multipart/form-data" action="page2.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />Choose a Text File (maximum :100kb) :<input name="uploadedfile" type="file" />
<input type="submit" value="Insert Data" /></form>
In the page 2, I put this:
$theFile = "'".basename( $_FILES['uploadedfile']['name']) ."'";
echo $theFile;
$fileHandle = fopen($theFile, 'r') or die ("Unable to open the file");
As the result:
'2009.txt'
Warning: fopen('2009.txt') [function.fopen]: failed to open stream: No such file or directory in C:\wamp\www\Warrant\InputData.php on line 18
Unable to open the file
Anyone can help?