Why the empty object in S3 bucket?

how to remove this,

Can you confirm that when you list the files from the bucket what the payload is that is returned?

That is merely the Name of the bucket as far as I can tell so your front end is not displaying the data correctly because of the way you constructed it... check how the data is being displayed in that component

The front end table displaying that data is not being constructed correctly. - what are you using for the table Data source?

Screenshot 2023-11-15 at 15.14.26

Looks like the first item is empty and that's the problem - Size = 0

the folder name is coming

fixed it by slicing the first item in array which is "invoices/"

1 Like

{{ getInvoices.data.Contents.slice(1) }} So it creates a new array and starting from index 1 at the end of the array

Perhaps remove
Screenshot 2023-11-15 at 9.37.23 AM

I can't because I need to get just invoices so the invoices are inside "invoices" folder

I guess invoices works if you are storing all invoices under that folder, but what I have found to work is that if you need to have different folders, you can set the filter to a filepath and save that filepath in your db and have it read as the filter if you have different clients that have their own invoices... just my 2 cents...
For example
the file path I store when uploading file(s) for specific clients, would be:
and store that as filepath in my db and then when looking at client and retrieving an invoice, I would get the filepath and use it as the filter....

1 Like

In my case I need to retrieve all the data and show it in the table

1 Like

Can I know what can cause a problem by default when app is opened and the table is show with pdf reader when I retrive all the data I extract invoices/ and .pdf from every item and leave just key for example 23-00001 and at file preview read file s3 I set invoices/ + selectedRow.Key + .pdf but for the first time is causing error saying the file key does not exist as I debugged for the first time the key is staying like its coming from s3 invoices/23-00001.pdf
And as we hard coded at read file invoices/selectedRow.Key.pdf its duplicating the full filename then after I selected another row everything fixes

Ps: table default row with index

Sorry I am not following... maybe some screenshots?

Fixed it by creating another column on table and getting direct key from fullKey s3 as it is with invoices/ + .pdf patterns without extracting these parts and another column just key with extracted parts so whenever I need to preview or download invoices I have full key in column fullKey so there is no problem anymore