简体   繁体   中英

Retrieving a file name to attach to an email with SwiftMailer and PHP

I am able to attach a file using SwiftMailer with its name hardcoded. But what if the file is uploaded by a user from an HTML form's 'file input type control and has to be sent with an email by a PHP script? How do I specify the file name in SwiftMailer?

Thank you!

I'm pretty sure in this case you could use the $_FILES['file']['tmp_name'] value. This gives the path to the temporary uploaded file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM