vibe-gx 3.0.0 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -1
- package/package.json +1 -1
- package/vibe.js +1 -0
package/README.md
CHANGED
|
@@ -269,7 +269,7 @@ app.post(
|
|
|
269
269
|
{
|
|
270
270
|
media: {
|
|
271
271
|
dest: "uploads", // Subfolder destination
|
|
272
|
-
public: true, // Save
|
|
272
|
+
public: true, // Save in public folder (default: true)
|
|
273
273
|
maxSize: 5 * 1024 * 1024, // Max file size: 5MB
|
|
274
274
|
allowedTypes: ["image/jpeg", "image/png", "image/*"], // Wildcards supported
|
|
275
275
|
},
|
|
@@ -278,6 +278,42 @@ app.post(
|
|
|
278
278
|
);
|
|
279
279
|
```
|
|
280
280
|
|
|
281
|
+
### Public vs Private Uploads
|
|
282
|
+
|
|
283
|
+
**Public uploads** (web-accessible):
|
|
284
|
+
|
|
285
|
+
```javascript
|
|
286
|
+
app.post(
|
|
287
|
+
"/upload/avatar",
|
|
288
|
+
{
|
|
289
|
+
media: {
|
|
290
|
+
public: true, // ✅ Files accessible via HTTP
|
|
291
|
+
dest: "avatars", // Saved to: public/avatars/
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
handler,
|
|
295
|
+
);
|
|
296
|
+
|
|
297
|
+
// Files accessible at: http://yourapp.com/avatars/filename.jpg
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Private uploads** (server-only access):
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
app.post(
|
|
304
|
+
"/upload/documents",
|
|
305
|
+
{
|
|
306
|
+
media: {
|
|
307
|
+
public: false, // 🔒 Files NOT web-accessible
|
|
308
|
+
dest: "documents", // Saved to: private/documents/
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
handler,
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// Files only accessible via your backend code (e.g., sendAbsoluteFile)
|
|
315
|
+
```
|
|
316
|
+
|
|
281
317
|
### Uploaded File Object
|
|
282
318
|
|
|
283
319
|
```javascript
|
package/package.json
CHANGED