[mapserver-commits] r10984 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Fri Feb 11 23:22:51 EST 2011
Author: warmerdam
Date: 2011-02-11 20:22:51 -0800 (Fri, 11 Feb 2011)
New Revision: 10984
Modified:
trunk/mapserver/mapwcs20.c
Log:
updated wcs 2.0 header arrangement (#3673)
Modified: trunk/mapserver/mapwcs20.c
===================================================================
--- trunk/mapserver/mapwcs20.c 2011-02-12 04:22:41 UTC (rev 10983)
+++ trunk/mapserver/mapwcs20.c 2011-02-12 04:22:51 UTC (rev 10984)
@@ -1893,32 +1893,28 @@
{
if(multipart)
{
- msIO_fprintf(
- stdout,
- "--wcs\n"
- "Content-Type: %s\n"
- "Content-Description: coverage data\n"
- "Content-Transfer-Encoding: binary\n"
+ msIO_fprintf( stdout, "--wcs\n" );
+ }
+ msIO_fprintf(
+ stdout,
+ "Content-Type: %s\n"
+ "Content-Description: coverage data\n"
+ "Content-Transfer-Encoding: binary\n",
+ MS_IMAGE_MIME_TYPE(map->outputformat));
+
+ if( fo_filename != NULL )
+ msIO_fprintf( stdout,
+ "Content-ID: coverage/%s\n"
+ "Content-Disposition: attachment; filename=%s%c%c",
+ fo_filename,
+ fo_filename,
+ 10, 10 );
+ else
+ msIO_fprintf( stdout,
"Content-ID: coverage/wcs.%s\n"
"Content-Disposition: INLINE%c%c",
MS_IMAGE_EXTENSION(map->outputformat),
- MS_IMAGE_MIME_TYPE(map->outputformat),
- MS_IMAGE_EXTENSION(map->outputformat),
10, 10 );
- }
- else
- {
- if( fo_filename != NULL )
- msIO_fprintf( stdout,
- "Content-Disposition: attachment; filename=%s\n",
- fo_filename );
-
- msIO_fprintf(
- stdout,
- "Content-Type: %s\n%c",
- MS_IMAGE_MIME_TYPE(map->outputformat),
- 10);
- }
status = msSaveImage(map, image, NULL);
if( status != MS_SUCCESS )
@@ -1984,38 +1980,29 @@
unsigned char block[4000];
int bytes_read;
- if( i == 0 )
+ if( i == 0
+ && !EQUAL(MS_IMAGE_MIME_TYPE(map->outputformat), "unknown") )
mimetype = MS_IMAGE_MIME_TYPE(map->outputformat);
if( mimetype == NULL )
mimetype = "application/octet-stream";
if(multipart)
{
- msIO_fprintf(
- stdout,
- "--wcs\n"
- "Content-Type: %s\n"
- "Content-Description: coverage data\n"
- "Content-Transfer-Encoding: binary\n"
- "Content-ID: coverage/%s\n"
- "Content-Disposition: INLINE%c%c",
- mimetype,
- all_files[i],
- 10, 10 );
+ msIO_fprintf( stdout, "--wcs\n" );
}
- else
- {
- msIO_fprintf( stdout,
- "Content-Disposition: attachment; filename=%s\n",
- all_files[i] );
-
- msIO_fprintf(
- stdout,
- "Content-Type: %s\n%c",
- mimetype,
- 10 );
- }
+ msIO_fprintf(
+ stdout,
+ "Content-Type: %s\n"
+ "Content-Description: coverage data\n"
+ "Content-Transfer-Encoding: binary\n"
+ "Content-ID: coverage/%s\n"
+ "Content-Disposition: attachment; filename=%s%c%c",
+ mimetype,
+ all_files[i],
+ all_files[i],
+ 10, 10 );
+
fp = VSIFOpenL(
CPLFormFilename("/vsimem/wcsout", all_files[i], NULL),
"rb" );
More information about the mapserver-commits
mailing list