Hey guys. I am having trouble with a script that I "think" should be working, but it isn't.
I am trying to upload some files, open each one, read the contents and then (for now) echo the contents.....eventualy I will parse the contents and put it in a database.
I get a ton of errors when I run this code and I am not sure why. Can anyone see anything wrong here? Thanks.
Here is the code
foreach($_FILES as $Image){
$imageTempName = $Image['tmp_name'];
$imageName = $Image['name'];
$imageType = $Image['type'];
$imageError = $Image['error'];
$imageSize = $Image['size'];
$handle = fopen($imageTempName, "r");
echo fread($handle, filesize($imageSize));
fclose($handle);
}//end for
Here are the errors
Warning: filesize() [function.filesize]: stat failed for 124 in /addreport2.php on line 55
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /addreport2.php on line 55
Warning: filesize() [function.filesize]: stat failed for 0 in /addreport2.php on line 55
Warning: fread(): supplied argument is not a valid stream resource in /addreport2.php on line 55