vlevsha
vlevsha

Reputation: 265

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!

Upvotes: 2

Views: 226

Answers (1)

Ben Harris
Ben Harris

Reputation: 5684

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.

Upvotes: 1

Related Questions