Hello,
I'm running a small intranet where you can upload files to the server.
Now from time to time I experience upload corruption.
Especially when uploading images and EPS files.
On some files it adds 2 newlines at the top.
So the eps or jpeg files wont open. (firefox displays the jpeg is corrupt)
Now when i just cut out the two newlines at the top then the file is a perfect match to the original and does load.
Weird thing is that it does not always do this. I'm still figuring out when and how.
My server system is a stock debian sarge with apache 2.0.
PHP Version 5.1.2-0bpo1
Apache/2.0.54 (Debian GNU/Linux) mod_jk2/2.0.4 PHP/5.1.2-0bpo1 mod_ssl/2.0.54 OpenSSL/0.9.7e mod_perl/1.999.21 Perl/v5.8.4
Loaded Modules core mod_access mod_auth mod_log_config mod_logio mod_env mod_setenvif prefork http_core mod_mime mod_status mod_autoindex mod_negotiation mod_dir mod_alias mod_so mod_auth_pam mod_cgi mod_jk2 mod_macro mod_perl mod_php5 mod_rewrite mod_ssl mod_userdir
Now here my sourcecode of the upload thingie:
<?php
if($POST['btnupload']){
$uploaddir = '/data/webroot/internal/intranet/assets/';
$uploadfile = $uploaddir . '/'. basename($FILES['file']['name']);
move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile);
}
?>
The relevant form elements:
<form action="" method="post" enctype="multipart/form-data" name="upload" id="upload">
<input name="file" type="file" size="50" />
<input name="btnupload" type="submit" id="btnupload" value="Upload" />
</form>
Anyone know what the problem could be ?
Thanks in advance