File Management
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,Files
The File Management add-on adds actions for the files and folders of your site. They create, rename and move folders, set folder permissions, rename files, synchronize the file system with the disk, pack and unpack archives, and upload files to an FTP server. Two of them also create Word documents.
Most of these actions take a file or folder as an ID or a path relative to the portal root, such as Clients/Acme/. Check each action's page for the formats it accepts. For example, Rename Folder doesn't accept folder IDs.
These actions are part of the File Management add-on (DnnSharp.FileManagement, product code FILEMNGM). The add-on is installed separately. The actions don't check the license when they run. If you don't see these actions, the add-on isn't installed.
To copy, delete or save files, or to delete folders, use the core File Management actions. They're always available.
Choosing an action
| Action | What it does | Use it to |
|---|---|---|
| Get or Create Folder | Returns a folder, creating it and any missing parent folders first. Saves its path and ID as tokens. | Make sure a destination folder exists, or build one folder for each customer or year. |
| Alter Folder Permissions | Adds allow permissions for roles or users to a folder, or replaces all its permissions. | Give a user a private folder, or give a department role access to a new folder. |
| Rename Folder | Renames a folder in its current parent folder. | Rename a folder when the customer or project it belongs to is renamed. |
| Move Folder | Moves a folder, with its files and subfolders, into another existing folder. | Move a closed project folder into an Archive folder. |
| Synchronize Folder | Updates the site's file system to match the files that are actually on disk. | Register files written straight to disk, for example by Unpack an archive or an external process. |
| Rename File | Renames a file in its current folder. The file keeps its extension. | Give an uploaded file a meaningful name, such as Invoice-[InvoiceNumber]. |
| Pack folder | Compresses the contents of a folder into an archive, such as a .zip file. | Let users download all the documents of a record in one file. |
| Get archive file names | Lists the files inside an archive without extracting it. | Check that an uploaded .zip has the files you expect before you extract it. |
| Unpack an archive | Extracts an archive into a folder, writing the files straight to disk. | Let users upload many files at once as a single .zip. |
| Upload to FTP | Uploads files from the site to an FTP or FTPS server. | Send exports to a partner's FTP server on a schedule. |
| Replace Tokens in Word Document | Creates a .docx from a Word template by filling in content controls whose titles contain tokens. | Generate contracts, offer letters or certificates from a form submission. |
| Convert from HTML to Word | Converts HTML into a .docx, optionally based on a Word template. Obsolete. | Maintain existing applications. For new ones, use Html to Word (.docx) - Experimental in the Word add-on. |
Files on disk and the file system
Plant an App keeps a list of the files and folders it knows about, called the file system. Files can also exist on disk without being in that list.
- Unpack an archive writes the extracted files straight to disk. They don't appear in the Files interface and have no file ID until you run Synchronize Folder. Synchronize Folder only works on folders that are already in the file system, so create the output folder first with Get or Create Folder, or synchronize its parent folder with
Synchronize Subfolderschecked. - Synchronize Folder is also what you run after an external process or custom code writes files into a portal folder. Target the folder you changed. A full synchronization can take a long time.
- Upload to FTP also uploads files that are on disk but not in the file system, as long as the folder they're in is registered.
- Archives. To read what's inside an archive without extracting it, use Get archive file names. Pack folder archives the whole folder, so to pack one file, copy it into an empty working folder first. Use
zipwhen you share archives. Thegz,bz2andxzformats hold a single file only.
Folders, names and permissions
- New folders. Get or Create Folder creates folders with the default permissions for their location. Use Alter Folder Permissions afterwards to restrict access. It can only add allow permissions or replace all of them. It can't remove a single permission or deny access.
- Public URLs. Anyone who knows a file's direct URL can download it from a standard folder, whatever the folder permissions. Use a secure folder type for sensitive documents. See Files.
- URLs change, file IDs don't. Renaming or moving a folder, or renaming a file, changes the URLs and paths of the files. Saved links that use the file ID keep working. Store file IDs rather than URLs when you can.
- Same-name files. Pack folder, Unpack an archive and Upload to FTP overwrite a file with the same name. Rename File and Rename Folder fail if the new name is already taken. The two Word actions let you choose between
RenameandOverwrite. - Amazon S3. To create a folder in S3, pass a storage connection ID to
Storage Connectionin Get or Create Folder. This only applies when the folder is created. To create the storage connection from an action, use Manage S3 Service Connection in the Amazon S3 Storage add-on. - Errors. Rename File and Rename Folder have an
Ignore errorsoption that logs the error and lets the next actions run. Upload to FTP skips missing files without an error, and Unpack an archive does nothing if the archive isn't found. Check each action's page.
Word documents
- Replace Tokens in Word Document fills in Word content controls whose Title contains a token. Text such as
[FirstName]typed directly into the document isn't replaced. Each control gets a single plain-text value, so the action can't repeat rows for a list of items. See Preparing the template. - Convert from HTML to Word is obsolete but still works. Its replacement is in the Word add-on.
- Both actions accept
.docxtemplates only. Use a folder path inFolderrather than a folder ID.
To create PDF or Excel files, see the PDF Generator and Excel add-ons. For all add-ons, see Add-ons.
Revised 10/02/2026