Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
Rocket.Chat
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RocketChat
Rocket.Chat
Commits
d6e2c40d
Commit
d6e2c40d
authored
9 years ago
by
rockhouse
Browse files
Options
Downloads
Patches
Plain Diff
First draft of file upload functionality
parent
88f6f4fe
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/fileUpload.coffee
+39
-0
39 additions, 0 deletions
lib/fileUpload.coffee
with
39 additions
and
0 deletions
lib/fileUpload.coffee
0 → 100644
+
39
−
0
View file @
d6e2c40d
if
Meteor
.
isServer
fileStore
=
new
(
FS
.
Store
.
GridFS
)(
'files'
,
{})
`
Files
=
new
FS
.
Collection
(
'Files'
,
{
stores
:
[
fileStore
],
filter
:
{
allow
:
{
contentTypes
:
[
'image/*'
]
}
}
})
`
if
Meteor
.
isClient
fileStore
=
new
(
FS
.
Store
.
GridFS
)(
'files'
)
`
Files
=
new
FS
.
Collection
(
'Files'
,
{
stores
:
[
fileStore
],
filter
:
{
maxSize
:
1048576
,
allow
:
{
contentTypes
:
[
'image/*'
]
},
onInvalid
:
function
(
message
)
{
toastr
.
error
(
message
);
}
}
})
`
# Allow rules
Files
.
allow
insert
:
->
true
update
:
->
false
download
:
->
true
remove
:
->
false
Files
.
deny
insert
:
->
false
update
:
->
true
remove
:
->
true
download
:
->
false
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment