Uploaded PDF Files Becoming Corrupt
Posted: Thu Jun 10, 2010 7:04 am
Users of our software can upload files to the server (linked to deals they are working on). The code used is below.
It no seems to be occurring more and more that after these files are uploaded they are not able to be opened, and a "File Corrupt" error. Any thoughts?
Code: Select all
$uploaddir = "uploaded_files/";
$f = $_FILES["doc"];
$file_id = uniqid();
$n = $uploaddir . $file_id . "." . get_ext($f["name"]);
copy($f["tmp_name"], $n);