Jump to content

PHP Form, is it possible to actually ATTACH a file?


aaricwon

Recommended Posts

Sure (kind of). Technically, when you submit a form with a file attached, it is uploaded. There is no changing that, nor need to change that. PHP puts it into a temporary location. For security reasons, you will still want to use the move_uploaded_file() function, but just put it into another temporary file. Then, just follow the many PHP examples for adding an attachment to an email. Finally, after sending it, just remove the file you temporarily had it stored in.

 

For sending emails with attachments, you may want to check out something like http://phpmailer.codeworxtech.com as writing the code for actually attaching a file to an email can get complicated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.