Length of MessagePart Body

Posted by jpatel7 on 14-Feb-2018 19:20

I am sending a file in HTTP request. If the length of the file content is greater than 30000, then messagePart doesn't contain the whole content. It only contains upto 30,000 with <<...MORE...>> at the end. Is there any way that messagePart contains the whole file and send it in HTTP request?

Here is my code:

lv-multiPartEntity:AddPart(lv-messagePart).
lv-messagePart     = new MessagePart("text/plain",
         new String(lv-tempFile)).
lv-messagePart:Headers:Put(
         HttpHeaderBuilder:Build(
            "Content-Disposition")
            :Value('form-data; name=' + quoter("primary"))
            :Header).
      lv-multiPartEntity:AddPart(lv-messagePart).
      lv-requestTempData = lv-messagePart:Body:ToString().
      copy-lob lv-requestTempData to file "C:\rex\temp\request.txt".
      message length(lv-requestTempData).

Posted by jbijker on 15-Feb-2018 01:11

I think it's a bug. Try to change text/plain to text/html - this won't truncate the longchar to 30000 bytes as it is currently doing.

All Replies

Posted by jbijker on 15-Feb-2018 01:11

I think it's a bug. Try to change text/plain to text/html - this won't truncate the longchar to 30000 bytes as it is currently doing.

Posted by Peter Judge on 15-Feb-2018 09:18

It depends on the version. This should have been fixed in 11.6.1.

in later versions you can also load the file into a OpenEdge.Core.Memptr (instead of a String type).

Posted by jpatel7 on 15-Feb-2018 11:43

Changed it to text/html. It is still truncating the longchar to 30000 bytes when I printed it in the file. But, it still worked somehow.

Thank you very much for your answer.

Posted by jpatel7 on 15-Feb-2018 11:44

I tried Memptr earlier. But, it didn't work.

Thank you for your answer.

This thread is closed