Skip to content

Commit

Permalink
fix header line terminations on multipart org output (#4430)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Aug 25, 2012
1 parent 93e0c3b commit 7266535
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions mapogroutput.c
Expand Up @@ -938,7 +938,7 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
static const char *boundary = "xxOGRBoundaryxx";
msIO_setHeader("Content-Type","multipart/mixed; boundary=%s",boundary);
msIO_sendHeaders();
msIO_fprintf(stdout,"--%s\n",boundary );
msIO_fprintf(stdout,"--%s\r\n",boundary );

for( i = 0; file_list != NULL && file_list[i] != NULL; i++ ) {
FILE *fp;
Expand All @@ -947,11 +947,10 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )

if( sendheaders )
msIO_fprintf( stdout,
"Content-Disposition: attachment; filename=%s\n"
"Content-Type: application/binary\n"
"Content-Transfer-Encoding: binary%c%c",
CPLGetFilename( file_list[i] ),
10, 10 );
"Content-Disposition: attachment; filename=%s\r\n"
"Content-Type: application/binary\r\n"
"Content-Transfer-Encoding: binary\r\n\r\n",
CPLGetFilename( file_list[i] ));


fp = VSIFOpenL( file_list[i], "r" );
Expand All @@ -969,9 +968,9 @@ int msOGRWriteFromQuery( mapObj *map, outputFormatObj *format, int sendheaders )
VSIFCloseL( fp );

if (file_list[i+1] == NULL)
msIO_fprintf( stdout, "\n--%s--\n", boundary );
msIO_fprintf( stdout, "\r\n--%s--\r\n", boundary );
else
msIO_fprintf( stdout, "\n--%s\n", boundary );
msIO_fprintf( stdout, "\r\n--%s\r\n", boundary );
}
}

Expand Down

0 comments on commit 7266535

Please sign in to comment.