开发者

TFMail : How to keep original name of attachments

开发者 https://www.devze.com 2023-01-12 06:42 出处:网络
TFMail was a popular CGI Form Mail script at one time. Unfortunately, my client insists on continuing to use it.I hope that there are people who still use it and are experts in using it.The best docu

TFMail was a popular CGI Form Mail script at one time.

Unfortunately, my client insists on continuing to use it. I hope that there are people who still use it and are experts in using it. The best documentation I can find is someone's home made reference sheet.

In my HTML form, I have an input named attachment1 :

 <inpu开发者_如何学Got type="file" name="attachment1" id="attachment1" />  

In my trc config file, I specify the types the attachment can be

# Upload File Types
upload_attachment1: jpg jpeg pdf xxx

In the email template, I display the original name of the file:

Original File Name of Attachment 1: {= param.attachment1 =}

So I fill out the form, and attach a file called myImage32.jpg

BUT in the email, the file gets renamed and attached as attachment1.jpg

How or where can I specify the name of the file? I'm going to end up with hundreds on files named attachment1.jpg if I leave it like this.


I don't know anything about TFMail, but I just glanced at the source code. On line 700 of TFmail.pl it is assigning the name of your input tag to be the filename for the attachment. It doesn't appear to be checking for any config options to set this filename.

It might be easy to modify. The actual file name ($filename variable) is assigned a few lines earlier. If you go this route make sure to clean-up $filename. Depending on the upload browser it might just be a filename or the whole file path.

0

精彩评论

暂无评论...
验证码 换一张
取 消