Length of MessagePart Body - Forum - OpenEdge Development - Progress Community
 Forum

Length of MessagePart Body

This question is answered

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).
Verified Answer
  • 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
  • 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.

  • 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).

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

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

    Thank you for your answer.