Hi,
I’ve a question about the following code, because the variable $contents stays empty after execution:
$filename = $formFiles['userfile']['tmp_name'];
$fd = fopen ($filename, "rb");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
After selecting a file with a form that initialises $formFiles then $filename contains the correct filename. I also tried to apply addslashes() on $filename but it also doesn’t work. $fd contains some pointer to the file, for example “id #2”, I used the parameter “rb”, because PHP runs on a windows platform. But $contents stays empty, can someone help me with this problem, because I’m desperate after hours debugging and the like.
I’m hope someone has a solution for my problem.
Thanks.
Henk.