Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attaching image to mail sent with cfmail

Status
Not open for further replies.

sevex

Programmer
Joined
Sep 18, 2001
Messages
74
Location
CA
I have a form that allows user to send a message with an image attached using a file input field. When the mail sends, it attaches the temp file (.tmp) for the image. Is there something I have to do with the image before sending it?
 
Are you uploading the image to the server first before attatching it to the email? - tleish
 
nope, just attaching it

mimeattach="#form.user_image#

straight from the form.
 
I'm guessing that saving the file, attaching it, then deleting it is the only solution?
 
You have to first upload the file to the server before you can properly attatch it using CFMAIL. - tleish
 
Alright. I want to allow users to send only gif or jpeg filetypes. Is there any way to verify this before saving the image so I can display an error message?
 
If you use <CFFILE>, you could do this:


<CFFILE action=&quot;Upload&quot;
...
ACCEPT=&quot;image/gif,image/jpeg&quot;>
...
>

HTH

MG
 
excellent. simple, functional, I like it!
Thanks
 
oh, but if a user uploads a filetype that isn't specified there, it gives a funky looking coldfusion error. I want to be able to display my own before this happens.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top