cancel
Showing results for 
Search instead for 
Did you mean: 

Error with PDF body in HTTP response multipart

former_member185943
Participant
0 Kudos

Hello!

I am reposting this question in this forum because I have got no reply on ABAP, General.

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--

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185943
Participant
0 Kudos

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

Former Member
0 Kudos

probably you're using an adaptive environment and your computer tries to anticipate what the noob in front tries to achieve.

your changes forth and back gave it enough of a hint )

glad you got it running.

anton

former_member185943
Participant
0 Kudos

Hi, Anton!

Thanks for hint! How can I know am I using adaptive environment or not? I am not using any frontend functions so far.

I have it all on my laptop - SAP NW 2004s trial and DMS.

Regards,

Igor

Former Member
0 Kudos

Sorry Igor,

this was just a joke.

regards, anton

former_member185943
Participant
0 Kudos

No worries! Oh, silly me! You were so realistic - I really thought that there was some "adaptive environment". Now I really have no explanation for what happened to my multipart response.

P.S. I have to take away your points

Igor