Hello,
I have a script that uploads files to a file repository where users can download these files through http, but for some reason I can't figure out the files end up corrupted. I tested it in three different servers, and the same problem occurs.
Has anybody experienced this before or does anybody have an idea why this could be happening? The script and form are below:
<?
if($submitted && $file && $file!="" && $file!="none") {
copy($file, BASE_PATH."/$repository/$file_name");
unlink($file);
}
?>
<form action="<? echo $PHP_SELF; ?>" enctype="multipart/form-data" method="post">
<input type="hidden" name="submitted" value="1">
<p><b>Upload New File</b><br>
file to be uploaded: <input type="file" name="file"><br>
name :<input type="text" name="file_name"><br>
<input type="submit" value="upload">
</form>
any insight would be greatly appreciated, thanks in advance.
Oliver