Sync your Frappe file attachments to SharePoint & Google Drive — and keep them in Frappe.
Features · How it works · Installation · Setup · Usage · Guide
FrapNexus extends Frappe’s built-in file handling so that whenever a file is attached to a record, it can be transparently uploaded to SharePoint or Google Drive in addition to — or instead of — Frappe’s local storage. You decide, per DocType, where files live and how their cloud folder structure is named.
It works by overriding Frappe’s core File document class, so it applies to every attachment
field across your site without touching your other apps.
Frappe only, Cloud only, or Both for each DocType.{name}-{field}. Attach a file ──▶ Frappe File (overridden) ──▶ FN Upload Rule for the DocType?
│
┌───────────────────────┼───────────────────────┐
▼ ▼ ▼
Frappe only Cloud only Both
(stock behaviour) (push to cloud, file_url (disk write +
points at the cloud) cloud mirror)
The cloud destination and folder path come from the FN Upload Rule matched to the attachment’s target DocType, resolved against the linked FN Cloud Connection.
Install with the bench CLI:
cd $PATH_TO_YOUR_BENCH
# get the app
bench get-app frapnexus $URL_OF_THIS_REPO --branch main/develop
# install onto a site
bench --site $SITE_NAME install-app frapnexus
# build the bundled assets (logo, branded form styles)
bench build --app frapnexus
bench --site $SITE_NAME clear-cache
Then reload your browser. A FrapNexus workspace is added to the desk home (visible to System Managers) with shortcuts to all DocTypes and the setup guide.
Requirements
google-api-python-client and google-auth (installed automatically)Go to FN Cloud Connection → New.
SharePoint
Sites.ReadWrite.All./sites/ in the SharePoint URL) and the
Drive Name (document library).Google Drive
Click Connect — a green Connected pill confirms the credentials work.
Go to FN Upload Rule → New.
| Field | What it does |
|---|---|
| Target Doctype | Which DocType’s attachments this rule governs |
| Storage Mode | Frappe only / Cloud only / Both |
| FN Cloud Connection | The connection to upload through |
| Naming Strategy | Original filename or a Templated name ({name}, {field}) |
| Conflict Behavior | Rename, Replace, or Fail on duplicates |
| Folder Segments | One row per folder level — watch the live path preview update |
Use the bundled FN Test Upload DocType (or any DocType you wrote a rule for), attach a file, and confirm it appears in the target SharePoint/Drive folder.
Once a rule is in place, no further action is needed — staff attach files the normal Frappe
way and FrapNexus routes them according to your rules. Cloud-only files have their file_url
pointed at the cloud copy, so links keep working from inside Frappe.
A full, illustrated setup-and-usage guide is bundled with the app and served at:
https://your-site/frapnexus-guide
FrapNexus overrides the core File DocType class (override_doctype_class) — intentionally and minimally. Cloud-only storage must send the upload to SharePoint/Google Drive instead of writing it to local disk, and Frappe performs that disk write inside File.save_file() during before_insert, where it can’t be intercepted via doc_events or post-save hooks. FrapNexus therefore overrides only save_file() to apply the matched FN Upload Rule, and delegates to super().save_file() for Frappe only storage and every other File operation.
This app uses pre-commit for code formatting and linting. Please
install pre-commit and enable it:
cd apps/frapnexus
pre-commit install
Configured tools: ruff, eslint, prettier, pyupgrade.
MIT · © Octo Advisory