You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-20Lines changed: 17 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,12 +2,13 @@ Autoform File
2
2
=============
3
3
4
4
### Description
5
-
Upload and manage files with autoForm using ostrio:files.
6
-
This was ported from yogiben:autoform-file to use ostiro:files instead of the now deprecated CollectionFS.
5
+
Upload and manage files with autoForm via [`ostrio:files`](https://github.com/VeliovGroup/Meteor-Files). This package was ported from `yogiben:autoform-file` to use with [`ostrio:files`](https://github.com/VeliovGroup/Meteor-Files) instead of the already deprecated CollectionFS.
##### 2. Create your Files Collection (See [ostrio:files](https://github.com/VeliovGroup/Meteor-Files.git))
7
+
### Quick Start:
8
+
9
+
- Install `meteor add ostrio:autoform-files`
10
+
- Install `meteor add ostrio:files`, *if not yet installed*
11
+
- Create your Files Collection (See [`ostrio:files`](https://github.com/VeliovGroup/Meteor-Files)))
11
12
```javascript
12
13
var Images =newFilesCollection({
13
14
collectionName:'Images',
@@ -32,12 +33,12 @@ if (Meteor.isServer) {
32
33
});
33
34
}
34
35
```
35
-
##### 3. Define your schema and set the `autoform` property like in the example below
36
-
```javascript
37
-
Schemas = {}
38
-
39
-
Posts =newMeteor.Collection('posts');
36
+
__Note:__`Images` variable must be attached to *Global* scope. And has same name (*case-sensitive*) as `collectionName` option passed into `FilesCollectio#insert({collectionName: 'Images'})` method, `Images` in our case.
40
37
38
+
- Define your schema and set the `autoform` property like in the example below
39
+
```javascript
40
+
Schemas = {};
41
+
Posts =newMeteor.Collection('posts');
41
42
Schemas.Posts=newSimpleSchema({
42
43
title: {
43
44
type:String,
@@ -48,7 +49,7 @@ Schemas.Posts = new SimpleSchema({
48
49
autoform: {
49
50
afFieldInput: {
50
51
type:'fileUpload',
51
-
collection:'Images',
52
+
collection:'Images'
52
53
}
53
54
}
54
55
}
@@ -57,17 +58,13 @@ Schemas.Posts = new SimpleSchema({
57
58
Posts.attachSchema(Schemas.Posts);
58
59
```
59
60
60
-
The `collection` property is the field name of your files collection.
61
+
The `collection` property must be the same as name of your *FilesCollection* (*case-sensitive*), `Images` in our case.
61
62
62
-
##### 4. Generate the form with `{{> quickform}}` or `{{#autoform}}`
63
+
- Generate the form with `{{> quickform}}` or `{{#autoform}}`
0 commit comments