Specifying the filename in _mimemail_file() . . .

oadaeh - February 18, 2008 - 07:43
Project:Mime Mail
Version:HEAD
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed
Description

When dealing with attachments using PHP, there is a filename and a temporary filename for each file. The way Mime Mail adds attachments, one can only give one of those as the file. If the file is only really represented by the temporary filename, then that is what must be passed to the function and that is the name that will be displayed to the end user. (Better documentation would have saved me hours of time trying to figure all this out.) The attached patch gives a third parameter to _mimemail_file() so that the actual name of the file may be specified along with the file, if desired, and if not, the default behavior is used.

I'm pretty sure this won't break any existing module's code, since, AFAICT from a scan of the modules in CVS, no one is using Mime Mail with attachments.

I did roll this against the 5.x branch, as that's the one I'm using, but I can create a HEAD version as well, if desired.

I will be using this in the Mass Contact module and pointing people to this patch, unless a better solution comes along.

AttachmentSize
mimemail.inc_.patch1.46 KB

#1

oadaeh - March 25, 2008 - 15:22

An updated patch to take into account other changes in the module.

It's still against the DRUPAL-5 branch.

AttachmentSize
mimemail.inc_.patch 1.43 KB

#2

jerdavis - August 6, 2008 - 04:15
Version:5.x-1.x-dev» HEAD
Status:needs review» fixed

Commited to HEAD - Thanks!

#3

Anonymous (not verified) - August 20, 2008 - 04:25
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.