Forum Discussion

smit66's avatar
smit66
New Contributor II
5 years ago

Downloading attachment from a REST POST response with content-type multipart/mixed

Hello,

My goal is to download an attachment from a REST POSAT response. The response header content-type value is multipart/mixed and a boundary.
I used multipart reader to extract the file. With the help of regex I have set the Content-Type property of multipart reader as “multipart/mixed;boundary=_Part_16478_1527467874.1613153938198”.
I try to write file afterwards. But multipart reader doesn’t produces any output (file writer is never executed).

Your suggestions will be helpful in finding me the right solution.

Thanks,
Smit

  • alchemiz's avatar
    alchemiz
    Contributor III

    You can use Digest.md5(Math.randomUUID()) instead of sha1

    • alchemiz's avatar
      alchemiz
      Contributor III

      You can also use Math.randomUUID().replace(/-/gi,‘’)