Archive Mode

Prev Next

In many cases, we might want to allow our end-users to delete files, but we want to keep the files they've deleted for safety, just in case a user may accidentally delete an important file.

For this, you can set the Document Portal to use Archive Mode. Archive mode instead sends "deleted" (we replace all delete verbiage in the view with archive) files to a separate sub-folder, so that all the files still exist in your cloud of choice.

Archive Mode is supported for all clouds except Quickbase—if using Quickbase, you can use the native file revision tool instead.

Turn on Archive Mode

Archive Mode is off by default. To turn it on, add the archivefiles parameter to the Document Portal button's formula, inside Base64Encode( ) with the other parameters:

& "&archivefiles=y"
& "&archivefolder=Deleted"   // optional; Deleted is the default

When Archive Mode is on, the portal says archive instead of delete: the button's tooltip is Archive Files, the context menu shows Archive Selected, the Settings window shows Allow Archive?, and success messages read Archive Success. For all parameters, see Formula URL parameters.

Example: archive a file in Dropbox

The following walks through archiving a file using Document Portal with Dropbox. The record's files are stored in the Dropbox folder Document Portal/bxxxxxxxx_9, which contains four files: eight.png, eleven.png, fifteen.png, and fourteen.png. (By default, each record's folder is named after the table's DBID and the record's Record ID#.)

  1. Open Document Portal. The grid lists the same four files, and the Cloud Folder Readout reads Files from Document Portal/bxxxxxxxx_9. Because Archive Mode is on, the Delete button in the button bar shows an archive box icon instead of a trash can.

  2. Select eleven.png and press Archive. A Confirm Archive window asks: Are you sure you would like to archive 1 file? After archiving, the file(s) will be in Document Portal/bxxxxxxxx_9/Deleted. Click Archive to continue, or Cancel.

  3. After you confirm, the file disappears from the Document Portal grid, which now shows three files. If you are in details mode, the file information on the related record is cleared (not the added columns, just the file-specific data). To keep that information on the record, use detailspreserve=y. If detailsdeleterecord is on, the related record is deleted instead.

  4. In Dropbox, the bxxxxxxxx_9 folder now contains a new sub-folder named Deleted alongside the three remaining files. Inside Deleted is the archived file. A number is added to its name so that archived copies never overwrite each other, for example eleven_639268938001234567.png.

Replace in Archive Mode

When Archive Mode is on, Replace Selected also keeps the old file: the previous version is copied into the archive sub-folder before the new file is saved in its place.

By default, the archive sub-folder is called Deleted, but you may override that with the archivefolder parameter. You can read more about these parameters and how to set them in Formula URL Parameters.