Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PDF in HTTP multipart response: missing boundary?

Former Member
0 Likes
966

Hello!

If I add my PDF to the HTTP response directly, everything works fine, so we can assume that the PDF is correct.

I need to create this response as <i>multipart/form-data</i>, and when I add the same PDF to the body of the <i>data</i> multipart (either by using ADD_CDATA or ADD_DATA methods), I get error message from the client: <i>data: Invalid argument</i>.

I examined the response by tunneling program and didn't see anything suspicious. Please see the response below.

Does anyone has experience with this?

Thanks in advance!

Regards,

Igor

Response:

HTTP/1.0 200 OK
content-type: multipart/form-data; boundary=ejjeeffe0
content-length:     35729
x-contentrep: AL
x-pversion: 0046
x-docid: 22b524a7-3c27-11dc-8168-8b337fac673a
x-docstatus: ONLINE
x-numbercomps: 1
x-datec: 2007-07-27
x-timec: 11:52:49
x-datem: 2007-07-27
x-timem: 11:53:11
server: SAP Web Application Server (1.0;700)

--ejjeeffe0
Content-Type: application/pdf
Content-Length: 35376
X-compId: data
X-compDateC: 2007-07-27
X-compTimeC: 11:52:49
X-compDateM: 2007-07-27
X-compTimeM: 11:53:11
X-compStatus: ONLINE
X-pVersion: 0046
X-Content-Length: 35376

%PDF-1.3
...
--ejjeeffe0--

Hello!

If I add my PDF to the HTTP response directly, everything works fine, so we can assume that the PDF is correct.

I need to create this response as <i>multipart/form-data</i>, and when I add the same PDF to the body of the <i>data</i> multipart (either by using ADD_CDATA or ADD_DATA methods), I get error message from the client: <i>data: Invalid argument</i>.

I examined the response by tunneling program and didn't see anything suspicious. Please see the response below.

Does anyone has experience with this?

Thanks in advance!

Regards,

Igor

Response:

HTTP/1.0 200 OK
content-type: multipart/form-data; boundary=ejjeeffe0
content-length:     35729
x-contentrep: AL
x-pversion: 0046
x-docid: 22b524a7-3c27-11dc-8168-8b337fac673a
x-docstatus: ONLINE
x-numbercomps: 1
x-datec: 2007-07-27
x-timec: 11:52:49
x-datem: 2007-07-27
x-timem: 11:53:11
server: SAP Web Application Server (1.0;700)

--ejjeeffe0
Content-Type: application/pdf
Content-Length: 35376
X-compId: data
X-compDateC: 2007-07-27
X-compTimeC: 11:52:49
X-compDateM: 2007-07-27
X-compTimeM: 11:53:11
X-compStatus: ONLINE
X-pVersion: 0046
X-Content-Length: 35376

%PDF-1.3
...
--ejjeeffe0--

1 REPLY 1
Read only

Former Member
0 Likes
718

Very strange thing happened: I changed the document to text/plain and it worked like charm. When I got back to my original PDF it also worked fine, and it stood fine up to now - "they lived happily ever after". Like there were never problems. I swear I didn't change anything else. Maybe if I spilled coffee on the box, it would be even better.

Igor