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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.