问题
In Meteor, what should be the directory for uploading images or files?
Currently this is my directory where I am uploading all the Images:
meteorApp/public/uploads/images/
But whenever I upload images, it refreshes my client. Its because Meteor is continuously looking for a change in its directory or files. So where should I set my uploads directory to?
回答1:
The solution is to put files in a place Meteor does not care about: hidden folder (.name), ignored folder (name~), or folder outside of Meteor directory.
Refer this answer.
回答2:
An alternative solution is to use the Collection FileSystem package which provides a complete file management solution like uploading, downloading, synchronization, copying, etc.
It can be then plugged to local filesystem or even Amazon S3.
Here is the repo : https://github.com/CollectionFS/Meteor-CollectionFS. You need to add first the main package :
meteor add cfs:standard-packages
And then the storage adapter you want to use:
Local filesystem (directory like /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 doc is really complete, you may find what you are looking for! :)
来源:https://stackoverflow.com/questions/34527629/to-which-directory-images-or-files-should-be-uploaded-in-meteor