appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
33.87k stars 3.65k forks source link

[Bug]-[266.6666666666667]:Document Viewer for PDF base64 #16593

Open jinglics opened 2 years ago

jinglics commented 2 years ago

Is there an existing issue for this?

Description

When I read the PDF file from s3 with base64 format, the document view always shows the URL / Base64 is invalid.

Steps To Reproduce

  1. connect to s3
  2. read pdf file with base64
  3. bind function result (fileData) to the document viewer
  4. invalid base64

Public Sample App

No response

Version

self-hosted latest version

dilippitchika commented 2 years ago

Thanks for bringing this to our attention @jinglics, we will triage it soon.

jdglacier commented 1 year ago

Any update on this issue?

dilippitchika commented 1 year ago

Hey @jdglacier not yet, can you please let me know your usecase?

jdglacier commented 1 year ago

Hey @dilippitchika, I need to be able to read PDF files from S3 (using the built-in S3 'Read file' command) and display the output base64 in the Document Viewer widget.

These files contain confidential data so public access to the S3 bucket must remain blocked (i.e. I can't just use the file URL in the Document Viewer widget).

Nikhil-Nandagopal commented 1 year ago

@jdglacier you can generate a signed URL for the file with an expiry time and use that to display it in the document viewer

Nikhil-Nandagopal commented 1 year ago

@jdglacier no that is an option in the S3 query under the list files operation

Screenshot 2022-10-17 at 6 22 57 PM
jdglacier commented 1 year ago

@Nikhil-Nandagopal My mistake, I don't know how I missed that. Thanks!

praneetloke commented 1 year ago

I am not sure if it's the way I am fetching the URL for the document viewer but it seems to complain about a bad URL despite returning a signed-URL from a JS object's function.

somangshu commented 1 year ago

@praneetloke 👋 Do you have a base64 URL? How did you manage to get the signed URL from the JS Object? Do you see the evaluated value in the document viewer widget? Are you using a Async JS function to achieve this? Can you show us a screenshot of the error you are seeing?

dilippitchika commented 1 year ago

Assuming 50% of doc viewer + s3 users face this challenge

Stats

Stat Values
Reach 100
Effort (months) 0.75