Hello,
I am trying to download all PDFs files locatated in one column from table with a button
The problem is that it downloads only 10 files and the table has ex. 31 rows with data.
How can I download all the files?
Code used
for row in app_tables.table_name.search(tables.order_by('EMPLOYEE',ascending=True)):
pdf=row["PDF"]
anvil.media.download(pdf)
Thank you
What happens if you split the rows into 3 batches and iterate of each batch to download? Does that work?
That’s the symptom. The problem is whatever’s causing the 11th to fail.
We don’t know what happened when you tried for more than 10. If we knew, we might be able to find you a more effective workaround.
As @p.colbert says, it would help knowing what is the problem.
If the problem is that the form times out because it takes longer than 30 seconds, then you could use a timer. Something like:
self.timer_1.interval = 0.01
self.iterator = app_tables.table_name.search(tables.order_by('EMPLOYEE',ascending=True))
def timer_1_tick(self, **event_args):
try:
row = next(self.iterator)
except StopIteration:
self.timer_1.interval = 0
return
pdf=row["PDF"]
anvil.media.download(pdf)
Thats the problem that I don’t see any failure, error or server timeout, as shown below. I am trying to download all the rows(31). Each PDF contains 1 page with numbers(not heavy). I also checked the table, all the 31 rows have PDF files without empty row on where I am searching, after 10 downloads it’s just stop

1 Like
Can you try on another computer or another browser?
This could be the browser preventing you from spamming the client with a burst of downloads.
Perhaps you should get all the pdf files, zip them in one large file and download that one.
4 Likes
Thank you, I tried Firefox, and works fine