HiraokaHyperTools / msgreader

35 stars 9 forks source link

Msgreader attachment dataURL blob is not working #38

Closed rakeshrio closed 1 year ago

rakeshrio commented 1 year ago

Hi @kenjiuno ,

{ "dataType": "attachment", "extension": ".png", "name": "abz-logo-gray-green.png", "fileName": "abz-logo-gray-green.png", "dataId": 167, "contentLength": 23719, "fileNameShort": "abz-lo~1.png", "pidContentId": "abz-logo-gray-green.png@SNC.ff224570c491543c", "creationTime": "Tue, 09 May 2023 11:56:21 GMT", "lastModificationTime": "Tue, 09 May 2023 11:56:21 GMT", "attachmentHidden": true, "dataUrl": "blob:http://localhost:9091/b6c03749-6c9c-4cbf-9bde-73d33ef8e694" }.

Iam getting dataURL but if its not working its showing undefined when i paste in search url pf browser, is there any other way to extract the attachment. expecting quick response, Thanks in advance

kenjiuno commented 1 year ago

The dataURL you mentioned will be an object URL obtained through URL.createObjectURL API.

The URL lifetime is tied to the document in the window on which it was created. The new object URL represents the specified File object or Blob object.

And,

Iam getting dataURL but if its not working its showing undefined when i paste in search url pf browser

Seriously there is a way to show undefined when we open the object url.

URL.createObjectURL(new Blob([undefined]))

2023-07-22_12h07_40

2023-07-22_12h07_25

Ensure the blob source is surely passed from msgreader.

I have written a demo about attachments.

https://hiraokahypertools.github.io/msgreader_demo2/

Sample code:

https://github.com/HiraokaHyperTools/msgreader_demo2/blob/d0e65691f58fbf1dca56eac3aa78389dc3e671bf/app/src/App.tsx

rakeshrio commented 1 year ago

Thanks for the insight and quick response