[mapserver-commits] r8477 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Jan 29 02:19:31 EST 2009
Author: sdlime
Date: 2009-01-29 02:19:27 -0500 (Thu, 29 Jan 2009)
New Revision: 8477
Modified:
trunk/mapserver/maptemplate.c
Log:
Added support for setting attachment filename (Content-disposition) via a format option for templated output.
Modified: trunk/mapserver/maptemplate.c
===================================================================
--- trunk/mapserver/maptemplate.c 2009-01-29 04:31:02 UTC (rev 8476)
+++ trunk/mapserver/maptemplate.c 2009-01-29 07:19:27 UTC (rev 8477)
@@ -235,7 +235,11 @@
return MS_FAILURE;
}
- if(mapserv->sendheaders) msIO_printf("Content-type: %s%c%c", outputFormat->mimetype, 10, 10);
+ if(mapserv->sendheaders) {
+ const char *attachment = msGetOutputFormatOption( outputFormat, "ATTACHMENT", NULL );
+ if(attachment) msIO_printf("Content-disposition: attachment; filename=%s\n", attachment);
+ msIO_printf("Content-type: %s%c%c", outputFormat->mimetype, 10, 10);
+ }
if((status = msReturnPage(mapserv, (char *) file, BROWSE, papszBuffer)) != MS_SUCCESS)
return status;
} else {
More information about the mapserver-commits
mailing list