Skip to content

FileUpload

Robert S.W. Carroll edited this page Mar 28, 2022 · 1 revision

The FileUpload() aims to make uploading files easier. To upload a file in quickbase, one first has to convert the file to base64 and wrap it all together in a special file dictionary for the value field to use. The FileUpload() helper handles all of these steps for you, by simply calling FileUpload(path='path/to/your/file.txt).

The FileUpload() helper can be imported from helpers:

from quickbase_json.helpers import FileUpload

You can then include the FileUpload() in the upload dictionary:

data_to_send = [
   {'3': {'value': 25}, '10': FileUpload(path='path/to/file.txt')}
]

Note: When using file upload, the value is omitted. The data can always be accessed with the inherited .get() method if needed.