"Auto Detect" for attachment content type.

Benton, Kevin kevin.benton at amd.com
Wed Apr 5 15:26:21 UTC 2006


> Cheap trick in browsers...
> 
> If you want to specify a file type via the URL of a CGI, use this
> 
> http://path/to/my.cgi/filename.ext?thisvar=that...
> 
> Apache knows enough to stop at the my.cgi.  The browser doesn't,
> however, and will take the extension specified.

To answer my own post, here's a better way...  The CGI should specify a
filename suggestion in the content header.  To do this, use
"Content-disposition: filename=<filename>" to specify the file name
suggestion to the user.  This is covered in RFC 2183 (1997).  See the
example below.

===== snip snip snip ====== cut here ======
Content-type: text/csv
Content-disposition: filename=mylist.csv

"Hello world", "abc", 2
===== snip snip snip ====== cut here ======

I think we should standardize on this method.

---
Kevin Benton
Perl/Bugzilla Developer/Administrator, Perforce SCM Administrator
Digital Media Pervasive Computing Solutions Group
Advanced Micro Devices
 
The opinions stated in this communication do not necessarily reflect the
view of Advanced Micro Devices and have not been reviewed by management.
This communication may contain sensitive and/or confidential and/or
proprietary information.  Distribution of such information is strictly
prohibited without prior consent of Advanced Micro Devices.  This
communication is for the intended recipient(s) only.  If you have
received this communication in error, please notify the sender, then
destroy any remaining copies of this communication.





More information about the developers mailing list