This page describes everything File Attachment Sweep can do, by sweep type and by option. For a short introduction, see the File Attachment Sweep overview. For every setting and the values it accepts, see Sweep configuration options.
Sweep types
Each sweep configuration has one type, which decides where the files go.
Type | What it does |
|---|---|
QB to Amazon S3 | Uploads each file to an Amazon S3 bucket. See Amazon S3. |
QB to Dropbox | Uploads each file to a Dropbox folder. See Dropbox. |
QB to SFTP | Uploads each file to a folder on an SFTP server. See SFTP server. |
QB to QB | Copies each file to a file attachment field in another Quickbase table. See Another Quickbase table. |
QB Get Size | Doesn't move any files. Writes each file's size to a field on the record. See File sizes only. |
Which records are swept
Nightly sweeps process every record returned by the report named in the configuration. The report must include the file attachment field and every field the configuration reads from the record: a custom S3 key or bucket field, a Dropbox or SFTP file name field, a field to copy to another table, and image size fields. If the file attachment field, the custom S3 key field, or the Dropbox file name field is missing from the report, the configuration doesn't run.
Triggered sweeps process only the record in the trigger. The report isn't used, so the record doesn't have to be in it.
Records with an empty file attachment field are skipped and counted as skipped.
The sweep reads the current version of the file in the file attachment field.
The table can be in a different Quickbase account from the one your Extensions Portal account uses; the configuration holds the account URL. If your app requires application tokens, the configuration holds the app token too.
Amazon S3
Bucket. Files go to the bucket named in the configuration. Optionally, the bucket name can come from a field on each record, so different records can go to different buckets.
Region. The configuration holds the bucket's region. If it's blank, US East (N. Virginia) is used. Supported regions: US East (N. Virginia), US East (Ohio), US West (N. California), US West (Oregon), US GovCloud West (Oregon), Canada (Central), South America (São Paulo), EU West (Ireland), EU West (London), EU Central (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Mumbai), Asia Pacific (Singapore), Asia Pacific (Sydney), and China (Beijing).
S3 key. The key is the file's name in the bucket. The sweep picks it in this order:
If Use file name as S3 key is on, the key is the file name (after the file name cleanup).
Otherwise, if a custom key field is set and the record has a value in it, the key is that value. This lets you build keys with a formula, for example to add a folder path or a random part that's hard to guess.
Otherwise, the key is the table ID, an underscore, and the Record ID#, for example
bqxxxxxxx_125.
If the configuration has a key suffix, it's added to every key after an underscore, for example bqxxxxxxx_125_invoices.
Metadata. Every file gets a filename metadata value with the file's name. Optionally, the configuration adds one more metadata tag; its value is the configured value followed by the file name.
Content type. The sweep sets the content type from the file extension, so browsers open the file correctly. Recognized extensions: avi, bmp, csv, doc, docx, gif, htm, html, jpg, jpeg, mp3, mpg, mpeg, png, ppt, pptx, pdf, tif, tiff, txt, wav, wma, wmv, xls, xlsb, xlsm, xlsx, xml, xps, and zip. Other files are uploaded without a content type.
File access. The configuration sets the access on each uploaded file: Private, Public (anyone with the link can read it), or Bucket owner (the bucket owner can read it).
Retries. If S3 times out, the sweep tries the same file again, up to 10 times.
Dropbox
Folder. Files go to the Dropbox folder set in the configuration, or to its override folder if one is set.
Existing files. Files are never overwritten. If a file with the same name is already in the folder, Dropbox saves the new file under a different name, and the sweep writes that name to the record.
File name from a field. The file can be saved under a name from a field on the record instead of its original name. This works with nightly sweeps; the field must be in the report.
Download link. The sweep creates a Dropbox link to each file and can write it to a field on the record. The link downloads the file directly instead of opening the Dropbox preview page.
Dropbox file ID. The sweep can write each file's Dropbox ID to a field on the record. The ID stays the same if the file is renamed or moved in Dropbox.
Retries. If Dropbox returns an error (for example, too many requests), the sweep waits 10 seconds and tries again, up to 5 times.
SFTP server
Connection. The configuration holds the server's host, port, user name, and password. Password sign-in is used.
Folder. Files go to the folder in the configuration. If none is set, they go to the folder the SFTP user lands in after signing in.
Existing files. The configuration decides whether a file with the same name on the server is replaced.
File name from a field. The file can be saved under a name from a field on the record. The sweep adds the original file extension, so the field should hold the name without one—for example,
INV-1001becomesINV-1001.pdf.Retries. If an upload fails, the sweep waits 10 seconds and tries again, up to 5 times.
Another Quickbase table
The QB to QB type copies each file into a file attachment field in a destination table. The configuration holds:
The destination account URL, table, and file attachment field. The destination can be in another Quickbase account; the configuration then holds a user token for that account.
Add Record or Update Record. Add Record adds a new record to the destination table for every file. Update Record updates the destination record that has the same Record ID# as the source record. With If not found, add on, a new record is added when there's no record with that ID.
Field mapping. One field value can be copied with the file, written as
source field ID:destination field ID—for example,6:12copies field 6 from the source record to field 12 in the destination. Use it to relate the new record to a parent, or to store the source record's ID.Date/time fields. A date/time field in the destination can be set to the time of the sweep, and so can one in the source table.
File size. If the configuration has a file size field, the size is written to the destination field with that same field ID.
File sizes only
The QB Get Size type downloads each file only to measure it. It writes the size, in bytes, to the configuration's file size field, and can also set a date/time field and check a checkbox field. Nothing is uploaded, and the file attachment field and record are never cleared or deleted. Use it to find out how much file attachment space a table uses before you plan a sweep.
Record updates
When Update Quickbase is on, the sweep updates the source record after each file. The file name, file size, and uploaded checkbox fields must all be set in the configuration for S3, Dropbox, and SFTP sweeps; a QB to QB sweep needs only the checkbox, and a QB Get Size sweep needs only the file size field.
Field | S3 | Dropbox | SFTP | QB to QB | QB Get Size |
|---|---|---|---|---|---|
Uploaded checkbox (checked) | Yes | Yes | Yes | Yes | Optional |
File name | Yes | Yes | Yes | — | — |
File size (bytes) | Yes | Yes | Yes | — (written to the destination) | Yes |
S3 key | Yes | — | — | — | — |
Download link and file ID | — | Optional | — | — | — |
Date/time of the sweep | Optional | Optional | Optional | Optional | Optional |
Clear the file attachment field | Optional | Optional | Optional | Optional | — |
Clear the file attachment field removes the file from the record once it's uploaded, which frees file attachment space. Delete the record deletes the whole source record once the file is uploaded; the record isn't updated first. Neither applies to QB Get Size.
Note: Test a configuration on a few records, and check the files at the destination, before you turn on clearing or deleting for a whole table.
File names
Before uploading, the sweep always cleans up the file name:
In the original name | Becomes |
|---|---|
| A space |
| An underscore |
Characters the server can't represent, such as some non-Latin characters | An underscore |
Periods before the extension | Removed—for example, |
With Remove special characters from file name on, the sweep removes more special characters. The cleaned-up name is the one written to the record and, for Dropbox and SFTP, the name of the uploaded file.
Image resizing
With Resize images on, images are resized before they're uploaded.
Which files. List the extensions to resize, each with its period, separated by semicolons—for example,
.jpg;.jpeg;.png. Other files are uploaded as they are.How. By a percentage (the aspect ratio setting), or to a width and height in pixels. If a percentage is set, it's used instead of the width and height.
Per-record sizes. The percentage, width, and height can come from fields on each record. With nightly sweeps, those fields must be in the report. If a record's field is empty—or with triggered sweeps—the sizes in the configuration are used.
If an image can't be resized, the sweep stops processing that configuration for the run. The remaining records are swept on the next run.
Limits
Maximum file size (MB). Files larger than this are skipped and left on the record.
Maximum number of files. The run stops after this many files.
Maximum total size (MB). The run stops after this much has been uploaded.
Leave a limit blank for no limit. When the run stops at a limit, the configuration's limit message is recorded with the run results. Records that weren't reached are swept on the next run.
How sweeps run
Each configuration's status decides how it runs:
Nightly sweep. Runs once a day, together with all other nightly configurations.
Triggered sweep. Runs for one record when the sweep receives a trigger for it.
Both. Runs nightly, and also for each trigger.
Configurations that are inactive, deactivated, or canceled don't run, even when triggered.
Triggered sweeps
A triggered sweep starts when a Quickbase email notification on your table sends the record's sweep parameters to the sweep. The message body holds the parameters, separated by spaces:
Parameter | Description | Sample |
|---|---|---|
| The ID of your sweep configuration. |
|
| The Record ID# of the record to sweep. Use the Record ID# field in the notification. |
|
| The configuration's key. It must match the key on the configuration, or the record isn't processed. Newer configurations require it. |
|
|
|
|
Send the notification to fasweep@mail.quickbasetools.com (EU: fasweepeu@mail.quickbasetools.com). For example:
configid=1234 recid=[Record ID#] configkey=a1b2c3 type=fasweepChoose when the notification fires to match your process—for example, when a record is added or when a file attachment field changes. Get your configuration ID and key from Quickbase support if you don't have them.
Errors and results
The sweep handles problems at two levels:
Record problems skip the record and continue with the next one: the file attachment field is empty, the file is over the maximum size, the file can't be downloaded, or the upload fails after retries (for example, because the S3 credentials or bucket are wrong). A skipped record isn't updated or cleared, so a later run tries it again if it's still in the report.
Configuration problems stop that configuration before any records are processed: the app isn't authorized for File Attachment Sweep in the Extensions Portal, there's no Quickbase user token on file, the sweep can't sign in to the SFTP server, a required field is missing from the report (nightly sweeps), or the configuration key is missing or doesn't match.
The results of each run are recorded for each configuration: start and end time, files swept, total size, records skipped, records deleted, and error messages. If files aren't being swept, see File Attachment Sweep troubleshooting, or open a technical support case with the name of your configuration and the Record ID# of a record that wasn't swept.