so i have a mail script which allows people to send attachments. This is
activated by an htmlform, which allows users to select the file from their
hard drive and post to the recipient.

The problem I have is this-

The file attachment is sent via email as a .dat file.

If I specify the name of the file and its attachment in a variable called
mail title all is well and good -

$mail_body .= "Content-type:$mime_type; name=\"$mail_title

This is of course if $mail_title is spomething likle "mypicture.jpeg", if I
leave the extension out then it os sent as a dat file.

Now firstly the mime type might change depending onthe typeoffile the user
wishes to send-
it may be an swf or a doc. If the user specifies the type of file it is then
this is fine.

If the user doesnt specify the typeoffile being sent then all I have to go
on is the name of the file uploaded which appears as a temp name such as-


so is their any way of auto detecting thje mime type of a file from simply
the 'file' inpuit box on the form or at any other stgae-- or does the user
have to declare the type of file they are sending?


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to