Get file path

Hi, I use following code to open an image file, and I can get its base64 encoding.
const aFile = await fs.getFileForOpening();
const contents = await{format: storage.formats.binary});
var photo_obj_base64 = await base64ArrayBuffer(contents);
Now, how can I get the path of the selected image? Thanks.

aFile.nativePath should get you what you need. Cf.

Hope this helps :slightly_smiling_face:


OK, It gets what I want, thanks! :grinning:

1 Like

I want to make a new rectangle, I can fill it with Rect.fill = new Color("#D3D3D3");
but how can I set the border color? Thanks.

Rect.stroke = new Color('#D3D3D3'); should get you what you’re looking for. Cf.

Possibly, if the stroke isn’t enabled at this point, you might have to enable it by using Rect.strokeEnabled = true;…

(Careful–two typos there that might mislead the unwary.)

1 Like