Which catalogs of images or files should be uploaded to the Meteor?

In Meteor, what should be the directory for downloading images or files?

This is currently my directory where I upload all the images:

meteorApp/public/uploads/images/ 

But when I upload images, it updates my client. Because Meteor is constantly looking for changes in its directory or files. So where should I set the download directory?

+1
source share
2 answers

The solution is to put the files in a place where Meteor does not care: a hidden folder (.name), an ignored folder (name ~) or a folder outside the Meteor directory.

Submit this answer .

+3
source

An alternative solution is to use the Collection FileSystem package, which provides a complete solution for managing files, such as upload, download, sync, copy, etc.

It can then be connected to the local file system or even to Amazon S3.

Here is the repo: https://github.com/CollectionFS/Meteor-CollectionFS . First you need to add the main package:

 meteor add cfs:standard-packages 

And then the storage adapter you want to use:

  • Local file system (directory, e.g. / public, / uploads)

    meteor add cfs:filesystem

  • Amazon S3 (my fav)

    meteor add cfs:s3

  • Gridfs

    meteor add cfs:gridfs

  • Even Dropbox!

    meteor add cfs:dropbox

The document is really complete, you can find what you are looking for! :)

0
source

Source: https://habr.com/ru/post/1238264/


All Articles