Skip to content
Advertisement

How to copy .2D file from web to S3 bucket? Failing on decode

I am copying files from a website to a S3 bucket. Everything else is copying fine, even odd extensions that I haven’t heard of before. The extension that I am having problems with is “.2D”.

Currently using this code, and it is working for all but the .2D files. Might be a VERSACAD file. Anyone work with this file or know how to figure out how to work with this? No, I can’t include an example.

It is failing on the r.data.decode(“utf’8”) line. Using “utf-16” doesn’t work either.

JavaScript

To save to s3 bucket:

JavaScript

WHAT WORKED I ended up having to do the following, but it worked. Thanks!!

JavaScript

Advertisement

Answer

Upload it in binary

from file path

JavaScript

from file object

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement