I am uploading a file with a php script and it physcally copies the file over to another file. There are no errors but the problem is that the file doesn't seem to copy correctly. Its a 4k gif file and it only copies as a 1k file. When I pull it off the server and open it in a image program it doesn't open. It gives me an end of file error.
here is my upload page:
<form enctype="multipart/form-data" action="uploadFile.php" method="post">
<input type="hidden" name="max_file_size" value="40000">
<input type="file" name="logo_file">
<input type="submit" value="send file">
</form>
here is the script:
$upfile = "images/".$logo_file_name;
if(!copy($logo_file, $upfile))
{
echo "could not copy file into folder<br>";
}
$fp = fopen($upfile, "r");
$contents = fread($fp, filesize ($logo_file));
fclose($fp);
$contents = strip_tags($contents);
$fp = fopen($upfile, "w");
fwrite($fp, $contents);
fclose($fp);
can anyone see if I am doing something wrong here.
Thanks for your help.