So I have a file upload script which works great with .gif, .jpg and .txt files. I've tried storing the files on server and as a BLOB (longblob & mediumblob), but I get the same result both times. When i try to fetch/download the file stored on the server, the file downloads correctly(correct mime/ext), but when WORD tries to open the .doc, it syas it can not and fails.
I'm not sure if the error is when i upload the file or when i download the file, but something is going on.
I've seen people have the same problem, but no one knows how to fix it.
please help.
oh, and I'm on a linux server.
this is the code i use to upload. my html form is setup correctly, and as far as the 'addslashes' goes, I tried mysql_escape_string, and both with the same result.
$tempFile = fopen($_FILES['resume']['tmp_name'], "rb");
$data = (fread($tempFile, fileSize($_FILES['resume']['tmp_name'])));
fclose();
$data = addslashes($data);