Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jalik/meteor-jalik-ufs-local
Local file system store for UploadFS
https://github.com/jalik/meteor-jalik-ufs-local
file-upload filesystem meteor
Last synced: 3 months ago
JSON representation
Local file system store for UploadFS
- Host: GitHub
- URL: https://github.com/jalik/meteor-jalik-ufs-local
- Owner: jalik
- License: mit
- Created: 2015-07-26T02:31:52.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2022-03-19T01:07:59.000Z (almost 3 years ago)
- Last Synced: 2024-04-14T06:18:25.775Z (9 months ago)
- Topics: file-upload, filesystem, meteor
- Language: JavaScript
- Homepage:
- Size: 20.5 KB
- Stars: 8
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# UploadFS Local Store
A local file system store for UploadFS.
## Installation
To install the package, execute this command in the root of your project :
```
meteor add jalik:ufs-local
```If later you want to remove the package :
```
meteor remove jalik:ufs-local
```## Creating a Store
**The code below is available on the client and the server.**
Specify the **path** where you want to save the files.
Be aware that you must not change the path, neither the name of the store
if you have already saved files or you will break the URLs.
```js
import {Mongo} from 'meteor/mongo';
import {LocalStore} from 'meteor/jalik:ufs-local';// Declare store collection
const Photos = new Mongo.Collection('photos');// Declare store
const PhotoStore = new LocalStore({
collection: Photos,
name: 'photos',
path: '/uploads/photos',
mode: '0744', // directory permissions
writeMode: '0744' // file permissions
});
```## Getting store local path
```js
let path = PhotoStore.getPath();
```## Getting file path
```js
let path = PhotoStore.getFilePath(fileId);
```## License
This package is released under the [MIT License](http://www.opensource.org/licenses/MIT).