Overview

Prev Next

Overview of File Attachment Sweep

File Attachment Sweep moves files out of a file attachment field in your Quickbase app and into other storage: your Amazon S3 bucket, your Dropbox folder, your SFTP server, or a file attachment field in another Quickbase table. Use it to free up file attachment space in your app, to keep your files in a storage service you already use, or to deliver files to another system, such as a partner's SFTP server. After each file is moved, the sweep updates the Quickbase record, so you can still see which file belongs to which record and where it went.

Choose the files to sweep

Each sweep is set up as a sweep configuration for one table. The configuration names the file attachment field to sweep and a report on that table. Every time the sweep runs, it processes the records the report returns:

  • Records whose file attachment field is empty are skipped.

  • To sweep each file only once, filter the report so it leaves out records that were already swept—for example, records where the sweep's uploaded checkbox is already checked.

  • One table can have more than one configuration, for example, one per file attachment field.

Where the files go

Destination

What the sweep does

Amazon S3

Uploads each file to your S3 bucket. The S3 key (the file's name in the bucket) is, by default, the table ID and the record ID (for example, bqxxxxxxx_125). Instead, the key can come from a field on the record, or be the file's name. A suffix can be added to every key. The bucket can also come from a field on the record, so different records can go to different buckets. The sweep writes the S3 key to a field on the record.

Dropbox

Uploads each file to your Dropbox folder. If a file with the same name is already there, Dropbox keeps both and gives the new file a different name. The file can be saved under a name taken from a field on the record. The sweep can write the file's direct download link and its Dropbox file ID to fields on the record.

SFTP server

Uploads each file to a folder on your SFTP server. You choose whether a file with the same name is replaced. The file can be saved under a name taken from a field on the record; the original file extension is kept.

Another Quickbase table

Copies each file to a file attachment field in another table, in the same Quickbase account or a different one. The sweep either adds a new record in the destination table or updates an existing one (and can add the record if it isn't found). It can copy one other field value with the file, write the file size, and set a date/time field in the destination table.

File sizes only

Doesn't move anything. The sweep reads the size of each file and writes it to a field on the record, so you can report on how much space your files use.

What happens to the Quickbase record

After a file is swept, the sweep can update the record with:

  • An uploaded checkbox, checked to show the file was swept.

  • The file name and file size.

  • Where the file went: the S3 key, or the Dropbox download link and file ID.

  • The date and time of the sweep.

The configuration can also clear the file attachment field after the file is uploaded. This is what frees up file attachment space in your app. Or it can delete the whole record after the file is uploaded; in that case, the record isn't updated.

Note: Clearing the file attachment field and deleting the record both remove data from your app. Test the configuration on a few records, and check that the files arrived at the destination, before you turn either option on for a whole table.

File options

  • Clean up file names. Characters that cause upload problems are removed or replaced in every file name. Optionally, the sweep removes more special characters from file names.

  • Resize images. Images with the file extensions you list are resized before they're uploaded—to a set width and height, or by a percentage. The size can be the same for every file or come from fields on each record.

  • Limits. Files larger than a maximum size (in MB) are skipped. A configuration can also stop after a maximum number of files or a maximum total size per run.

How it runs

File Attachment Sweep runs in the background; there's no button to select. Each configuration runs in one of these ways:

  • Nightly sweep. Once a day, the sweep processes every record the configuration's report returns.

  • Triggered sweep. The sweep processes one record at a time. A Quickbase email notification that you create sends the record's sweep parameters (the configuration ID, the record ID, and the configuration's key) to the sweep. You decide when the notification fires—for example, when a file is added to a record—so files are swept soon after they arrive. The configuration key must match, or the record isn't processed.

  • Both. Records are swept as they're triggered, and the nightly sweep picks up anything that's left.

Configurations that are inactive, deactivated, or canceled don't run.

If a file can't be swept—for example, it's larger than the maximum size, or the upload fails—the sweep leaves that record as it is and continues with the next one. The results of each run are recorded: the number of files swept, their total size, the number of records skipped or deleted, and any error messages. If files aren't being swept, see File Attachment Sweep troubleshooting, or open a technical support case and include the name of your configuration.

Before you start

  • Your Quickbase app must be authorized for File Attachment Sweep in the Extensions Portal, with a Quickbase user token on file. The sweep doesn't run for an app that isn't authorized.

  • For Amazon S3 or Dropbox, your S3 or Dropbox credentials must be saved in the Extensions Portal. For an SFTP server, you need the server's host, port, user name, password, and folder.

  • The table needs a report that includes the file attachment field, plus any fields the configuration reads from the record (such as a custom S3 key, bucket, file name, or image size field).

Learn more