Hi there
echo("<form name=\"file_upload\" method=\"POST\" enctype=\"multipart/form-data\" action=\"upload.php\"");
echo "<INPUT TYPE=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"1000000\">";
echo "<input type=\"file\" name=\"attachfile\" >";
echo "</form>";
then in upload.php to receive the file
if ($attachfile != "none") {
$image_data = addslashes((fread(fopen($attachfile, "r"), filesize($attachfile))));
$sql="Insert into Files set Message_ID='$message_id', file_name='$attachfile_name', ";
$sql.="file_size='$attachfile_size', file_mime_type='$attachfile_type', file_body='$image_data'";
if(!($result_attach = mysql_query($sql))) {
echo mysql_error();
}
}
The above code with dump the file into the database, U can also copy it to a location on the server if U want.
Regards Anurag