Hi all,
Im using an upload script that seems to be working fine. I get no errors. Anything below 60 kb works perfectly.
However when I upload an image over 60kb only part of is displayed. When I upload a .doc over 60 kb I get an error stating file name is invalid.
This is the upload script below. But this is the script we all know.
$cv_handle = fopen($temp_directory.$fileatt_name, "r");
$file_cv = (fread($cv_handle, filesize($temp_directory.$fileatt_name)));
db_query("UPDATE candidates SET cv='$file_cv', cv_mime='$fileatt_type' ,cv_name='$fileatt_name',cv_size='$fileatt_size', cv_creation_date = curdate(), cv_creation_time = curtime() WHERE candidate_key='".$HTTP_POST_VARS["candidate_key"]."'");
This is the display script
$output_result = mysql_query("SELECT $field, $mime, cv_name FROM $table WHERE $key_field='$key_value'");
$output_row = mysql_fetch_object($output_result);
header("Content-Disposition: attachment; filename=".$output_row->cv_name);
header("Content-type: ".$output_row->$mime);
echo $output_row->$field;
Any suggestions?