At 01:16 AM 9/19/96 +0000, you wrote:
*>This is how Qualcomm's Eudora mail client specifies file names in its
*>embedded MIME-compliant (?) attachments:
*>
*>> > >Content-Type: application/rtf; charset="us-ascii"
*>> > >Content-Disposition: attachment; filename="d44-21.rtf"
*>
*>That complies with RFC1806. There are *lots* of Eudoras out there.
*>
*>
*>Achim pointed out how MHonarc parses out the file name for an attached file:
*>
*>>from MhonArc/lib/mhexternal.pl:
*>>
*>> ## See if name argument is to be used
*>> ($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i;
*>>
*>> ^^^^^^^^^^^^^^ ^^^^^
*>>
*>> $nameparm =~ s/['"]//g;
*>> $nameparm =~ s/.*[\/\\:]//;
*>> if ($args =~ /usename/i) {
*>> $name = $nameparm;
*>> }
*>>
*>>as indicated by '^'s: Mhonarc is looking for filename in Content-Type
*>>header field and not for in content-disposition. You may try (untested
*>>/unverified/unproven...) to use instead
*>>
*>> (($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i) ||
*>> (($nameparm) = $fields{'content-disposition'} =~ /name=(\S+)/i);
*>
*>May I suggest:
*>
*> (($nameparm) = $fields{'content-disposition'} =~ /filename=(\S+)/i) ||
*> (($nameparm) = $fields{'content-type'} =~ /name=(\S+)/i);
*>
*>to give priority to RFC1806 and allow for the deprecated "name=" in RFC1521.
I second that.
Another question.
A little further in mhexternal.pl I find
Line 257:
} else {
$ret = join('', "<P>\n",
qq|<A HREF="$filename">|,
&htmlize($fields{'content-description'}) ||
$nameparm || $TYPE,
"</A></P>\n");
What would be against it to change that to something like
} else
{if (!($args =~ /usename/i)) {
$ret = join('', "<P>\n",
qq|<A HREF="$filename">|,
&htmlize($fields{'content-description'}) ||
$nameparm || $TYPE,
"</A></P>\n");
}
else {
$ret = join('', "<P>\n",
qq|<A HREF="$filename">|,
$nameparm || $TYPE,
"</A> $fields{'content-description'}</P>\n");
}
}
It would use the file name as a HREF and the link while adding the
description when 'usename' is active and leave the old situation in tact
when 'usename' is not used.
Why ? Well the discussion lists I maintain use a lot attached files
(word,rtf etc.). The htmlized archive of those lists form sort of a
retreiving mechanism for the listmembers to find/view these attachements.
They would like a clearer view on the attached files both in the names and
types. If they decide to download the file they expect the same filename as
the original.
I rebuild the pages with MhOnArc every hour. If I don't use 'usename' the
attachements will be filed with a number creating a new (identical) file in
every run. I've had a 2 Gb disk run full during my holydays with thousends
of rtf and bin files. I know I could clean everything up before rebuilding
the pages but this looks like an easier approach to me.
Just a thought.
Bye
Hendrik
-----------------------------------------------------------------
|************** Wageningen Agricultural University. ************|
| Department of Information Management and Datacommunication |
-----------------------------------------------------------------
Hendrik Klompmaker: Senior Technologist
Internet :
Hendrik(_dot_)Klompmaker(_at_)Net(_dot_)IenD(_dot_)Wau(_dot_)Nl
X400 : c=nl;a=400net;p=surf;o=wau;ou1=IenD
: ou2=Net;s=klompmaker;gi=hendrik
Phone : +31 (0)317-484059
Fax : +31 (0)317-482970
Snail : Dreijenplein 2
6703 HB Wageningen / The Netherlands
--------------------------------------------------------