nocobase-app-plugin-file
यह क्या करती है
यह स्किल NocoBase 3 ऐप में file collections, अपलोड, डाउनलोड और preview जोड़ती है। यह उन डेवलपर्स के लिए है जिन्हें business रिकॉर्ड पर attachments चाहिए।
कब इस्तेमाल करें
- ✓जब आप चाहते हैं कि users NocoBase ऐप में business रिकॉर्ड के साथ फ़ाइलें जोड़ें।
- ✓जब आपको ऐप में Word, Excel या PowerPoint फ़ाइलों का preview चाहिए।
- ✓जब UI library से कोई file component पेज पर जोड़ना हो।
Skill का लिंक
https://github.com/nocobase/nocobase/blob/v3-develop/packages/plugins/app-plugin-file/skills/nocobase-app-plugin-file/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“क्या आप users को हर ऑर्डर के साथ फ़ाइलें जोड़ने दे सकते हैं, और मेरे NocoBase ऐप में Word या Excel attachments का preview दिखा सकते हैं?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
AI file plugin की services और route helpers का उपयोग करता है, फिर ऐप को चाहिए वे collections, पेज और अनुमतियाँ जोड़ता है। जहाँ उपलब्ध हों, वहाँ वह शामिल file preview components दोबारा इस्तेमाल करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Add files to an App
Use @nocobase/app-plugin-file/server and @nocobase/app-plugin-file/client. The plugin provides Repository managers, service tokens, and route helpers. The UI Library provides @nocobase/file-component-ui. The App or business plugin owns collections, migrations, Drive configuration, resource routes, permissions, and pages.
Inspect the App's existing registrations, migrations, disks, and resources first. Register the Server default export and the Client default factory before consumers, using the App's plugin lifecycle commands. The core does not create collections or routes.
Find and reuse the preview UI first
Inspect client/extensions/nocobase-file-component-ui/ before writing upload or preview components. Current Default templates preinstall this application-owned UI Library source and its client dependencies; older applications and other templates may not. Import from its index.ts, not from plugin-internal paths. Registering the plugin supplies services and translations; it does not automatically install or upgrade the copied UI.
| Format | UI Library preview | Content access |
|---|---|---|
| DOCX / XLSX / PPTX | Local @silurus/ooxml viewer |
Same-origin session credentials; no public URL or third-party service required |
| Raster image / PDF / text / Markdown / audio / video | Built-in preview components | See the content access rules below |
| Legacy DOC / XLS / PPT and OpenDocument | Office Online fallback | Internet-accessible absolute URL; cannot use the App session |
| Unsupported or unsafe active content | Explanation and optional download | Download still requires permission |
To show a record's files as thumbnails and chips, or take uploads beside a form or a comment, install the UI Library's attachment-list component (yes n | pnpm exec shadcn add @nocobase/attachment-list; its example is @nocobase/attachment-list-demo), map file records to AttachmentFile, and open FilePreviewDialog from its onPreview. For custom attachment lists, uploads or business associations, reuse FilePreviewDialog with file records and contentUrl; it requires no repository prop. Extend the existing UI or add the necessary content adapter rather than reimplementing format detection and dropping supported formats. A DOCX download fallback indicates a request/rendering failure or an outdated/custom component, not that the plugin lacks DOCX support. Report the actual failure and preserve its evidence.
If the installed package, synchronized Skill and copied UI disagree, inspect the resolved plugin version, run pnpm nocobase skills sync to refresh guidance, and reconcile the UI source separately. Skills synchronization does not upgrade UI Library copies.
Work incrementally
- Use standard File Repository routes, the Client File Repository and UI Library components for new attachment features. Save associations through the existing business API, whether standard CRUD or custom routes; do not migrate working business routes just to add files.
- Extend existing services, middleware, response adapters or installed UI components where needed. A necessary compatibility handler should delegate to File Repository; do not rebuild upload, storage and metadata handling with Drive or replace the whole CRUD stack.
- Inspect the App's registration, collection, disk and business save path together. Reuse what works; do not ask the user to choose an implementation or repeatedly explore source when the documented contract suffices.
- Verify one small upload → metadata query → content download before building UI. Then wire the returned IDs into the existing save/detail flow. Retain uploaded IDs if the business save fails, and run the affected checks after edits stabilize.
The following business example uses collection invoice_files, resource invoiceAttachments, connection main, and disk local. Adapt these to the App.
Collection
Create an App-owned, self-contained migration under database/main/migrations/ with
अक्सर पूछे जाने वाले सवाल
क्या plugin file tables अपने-आप बनाता है?
नहीं। collections, migrations और routes ऐप या किसी business plugin के होते हैं।
फ़ाइलें कहाँ सेव होती हैं?
उस storage disk में, जिसे ऐप कॉन्फ़िगर करता है।
कौन से previews कवर होते हैं?
स्किल Word, Excel और PowerPoint के previews कवर करती है।
जानकारी
लेखक का मूल विवरण
Add file collections, uploads, downloads, DOCX/XLSX/PPTX previews, business attachments, and editable UI Library file components to a NocoBase 3 App using the public File Repository services.
repo: nocobase/nocobase
लोकप्रियता
- GitHub स्टार
- 25k
- रैंकिंग में स्थान
- #10097
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
nocobase-app-development
25kयह आपके एजेंट को पूर्ण NocoBase 3 व्यावसायिक एप्लिकेशन के लिए पेज, routes, डेटा, अनुमतियाँ और टेस्ट बनाने में मदद करती है।
shadcn
25kयह आपके एजेंट को वेब प्रोजेक्ट में shadcn/ui कंपोनेंट खोजने, जोड़ने, ठीक करने और स्टाइल करने में मदद करती है, उनके आधिकारिक दस्तावेज़ और registries का उपयोग करके।
nocobase-app-plugin-development
25kयह आपके एजेंट को मौजूदा NocoBase 3 ऐप के भीतर plugins बनाने और उनकी देखभाल करने में मदद करती है, जिसमें server, client, database और registration के हिस्से शामिल हैं।
nocobase-app-upgrade
25kयह आपके एजेंट को NocoBase ऐप को नए template रिलीज़ तक अपग्रेड करने में मदद करती है, template के बदलाव लाते हुए आपका अपना काम बनाए रखते हुए।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।