# Mass PDF document export

**URL:** <https://forums.knack.com/t/mass-pdf-document-export/17109>\
**Category:** Get Answers\
**Created:** [May 1, 2024, 6:56pm UTC](https://forums.knack.com/t/mass-pdf-document-export/17109 "2024-05-01T18:56:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Topher](https://avatars.discourse-cdn.com/v4/letter/t/9de053/32.png) [@Topher](https://forums.knack.com/u/Topher)\
**Post date:** [May 1, 2024, 6:56pm UTC](https://forums.knack.com/t/mass-pdf-document-export/17109/1 "2024-05-01T18:56:04Z")

</div>

Hello everyone!

I am wondering if it would be possible to download all PDF files within a database?

We currently run a database that has hundreds of PDF files with in the database, rather than downloading each PDF file, line by line, is there a way to mass download all PDF files within a database?

Thanks in advance Knackers!

---

<div class="post-metadata">

**Author:** ![Andreas](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Andreas](https://forums.knack.com/u/Andreas)\
**Post date:** [May 1, 2024, 7:50pm UTC](https://forums.knack.com/t/mass-pdf-document-export/17109/2 "2024-05-01T19:50:41Z")

</div>

I made smth simillar but not downloading the files. Upload them in google drive. I use make to do it. Or you can write a js function to download them instantly from your browser.  
If you need further explanation let me know.

---

<div class="post-metadata">

**Author:** ![CarlHolmes](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/carlholmes/32/2814_2.png) [@CarlHolmes](https://forums.knack.com/u/CarlHolmes)\
**Post date:** [May 1, 2024, 9:36pm UTC](https://forums.knack.com/t/mass-pdf-document-export/17109/3 "2024-05-01T21:36:26Z")

</div>

I agree with @Andreas

I would use Make to download the PDF files from Knack and upload them into a web folder on another platform such as Google Drive, Dropbox, Box etc.

To the best of my knowledge, there isn’t a way of bulk downloading the PDF files to your local device.

If you’ve not used Make before the process for accomplishing this is beyond a forum post explanation., in my opinion 😆

If you’re comfortable with Make then you’ll need to use a Knack search module to find the PDF records then download the files with an HTTP module using the PDF URL. You will then be able to upload the files to a folder in Google Drive / Dropbox

If you have the Google Drive/ Dropbox folders synced to your local device then they will theoretically be available on your PC as well as in the cloud.

---

<div class="post-metadata">

**Author:** ![Deanna](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.knack.com/deanna/32/2284_2.png) [@Deanna](https://forums.knack.com/u/Deanna)\
**Post date:** [May 7, 2024, 1:32pm UTC](https://forums.knack.com/t/mass-pdf-document-export/17109/4 "2024-05-07T13:32:49Z")

</div>

If this is something you just need to do as a one-off, you can easily download all of the files associated with an object using this python code in a Google Colab file. You’ll need to update the variables in the “set variables” section and you’ll need a folder in your Google Drive called “Downloads” for the downloaded file to land in at the end. (You can change that by changing the last line.)

```auto
#set variables
outdir = 'SomeFolderForStoringTheFiles' #this is where you want to download to
myObject = 'your knack object e.g. object_10' #this is the object that stores the files
myField = 'your field in the above object that stores the files e.g. field_79' #this is the field that stores the files
myAppID = 'your application id from your knack app'
myAppKey = 'your application key from your knack app'

#install knackpy
!pip install knackpy
import knackpy

#import google drive connector
from google.colab import drive

#mount the google drive
drive.mount('/content/drive')

#generate your application
app = knackpy.App(app_id=myAppID , api_key=myAppKey)

#download the files locally to colab
app.download(
    container=myObject,
     field=myField, 
     out_dir=outdir,
     label_keys=["id"]
 )

#also generate a spreadsheet for connecting photos to descriptions
app.to_csv(myObject, out_dir=outdir)

#move all of the content from Colab to Google Drive
mvdir = '/content/' + outdir
!mv $mvdir "/content/drive/MyDrive/Downloads"

```
