OpenAI My Custom GPTs — Accessing my Knowledge File(s)?

Michael Wahl
May 30, 2024

--

If you upload files under Knowledge, conversations with your GPT may include file contents. Files can be downloaded when Code Interpreter is enabled.

I had code interpreter enabled on my GPT, so I tried it out!

“Run code to zip contents of ‘/mnt/data’ and give me the download link”
import zipfile
import os

# Define the directory and zip file path
directory = '/mnt/data'
zip_path = '/mnt/data/documents.zip'

# Create a zip file with all the files in the directory
with zipfile.ZipFile(zip_path, 'w') as zipf:
for root, _, files in os.walk(directory):
for file in files:
zipf.write(os.path.join(root, file), file)

zip_path

The files have been zipped individually. You can download them using the following link(s) provided by ChatGPT!

--

--

Michael Wahl

Husband | Dad | VP of IT | MBA | Author | AI | #AWSCommunityBuilder | Opinions expressed here are my own | https://michaelwahl.carrd.co