Meteor-Files | 🚀 Upload files via DDP or HTTP to ☄️ Meteor server FS | Runtime Evironment library
kandi X-RAY | Meteor-Files Summary
kandi X-RAY | Meteor-Files Summary
Stable, fast, robust, and well-maintained Meteor.js package for files management using MongoDB Collection API. What does exactly this means? Calling .insert() method would initiate a file upload and then insert new record into collection. Calling .remove() method would erase stored file and record from MongoDB Collection. And so on, no need to learn new APIs. It's flavored with extra low-level methods like .unlink() and .write() for complex integrations.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Recursively parse JSON dates
- Execute the function
Meteor-Files Key Features
Meteor-Files Examples and Code Snippets
Community Discussions
Trending Discussions on Meteor-Files
QUESTION
I'm trying to use ostrio:files aka Meteor-files with s3. When using the example s3 code running Images.insert on the CLIENT returns insert is not a function. My code is exact to example on the s3 integration page other than changing the collection name. Is there additional code needed, or can someone post an example of client side code for the s3 path? I am not using templates, im using react for front-end, though this is basic js. Works perfectly fine if i swap the code in images.js with original non-s3 code for collection-fs, fyi.
...ANSWER
Answered 2019-Dec-03 at 05:06The code example from Meteor-Files doesn't export
anything as a module, so when you import the default export, you get an empty object {}
.
Additionally, as the example explains, that code should be on the server side only, which means you can't import it on the client.
I would solve this by having three files:
QUESTION
I have a meteor collection with the below structure. This actually comes from a Meteor-files
collection by ostrio
.
ANSWER
Answered 2019-Feb-09 at 15:26You can use the dot notation to query a nested field
QUESTION
I am using Ostrio/files also known as meteor-files (from VeliovGroup or keenethics) on the server-side to insert a file to db.images, db.fs.files and db.fs.chunks. My code only manages to insert a record only in db.images and nothing on fs.files and fs.chunks. My code is as follows:
...ANSWER
Answered 2018-Jul-22 at 10:29I found the answer to my question. I set the fourth parameter to true i.e proceedAfterUpload=true and records are inserted in db.fs.files and db.fs.chunks. This is as per the write method documentation, it is slightly vague though. Here is the amended code:
QUESTION
I am following this tutorial, https://github.com/VeliovGroup/Meteor-Files/wiki/Image-Processing
I am successful on creating thumbnails. I am successful on adding versions in the collection.
I want to display the thumbnail. My problem now is how can I get link for tag?
For the original image, I used FilesCollection.link(fileRef)
.
How can I do it same in thumbnails?
I am using Veliov meteor-files package and GraphicMagick.
...ANSWER
Answered 2018-Jun-07 at 18:29I had the same issue, I think. Just to verify, there is a code snippet in the thumbnail generation that looks like this:
QUESTION
I got the ostrio:files
package working in my application, so my images are uploading to the server (as far as I know) and the DB has a reference to them, but I don’t know how to actually serve them up. For example, I uploaded an image this morning. The DB contains the original name, and the file path that it exists at now:
assets/app/uploads/Images/twLXDmCTiqyGy4Yq7.jpg
The problem is, when I put that into the url, it just returns my app’s homepage. I tried changing the upload directory to be /images/
but still have the same issue. I can’t seem to find a clear answer in Meteor’s documentation on how to open up a path for images, aside from including them when you build the package, but that defeats the purpose of user-input.
I also have noticed that the programs/web.browser/program.json
file in my application seems to control what is allowed to be visible, but ideally, I would just like to open up my /images directory to view any image (only direct paths, of course - I don’t want a directory listing). Is that a possibility?
Furthermore, I found the config.public
configuration option in the documentation, and set it to true, as well as setting the storagePath
and downloadRoute
paths. The paths I set are coming from the base of my server (using / for the start of the paths) but I still cannot seem to view any of the images that I upload - it just loads my default home page for my app
----EDIT----
Adding more detail for help in figuring this out.
I set up my FileCollection in my /imports/api/images.js
file, like this:
export const Images = new FilesCollection({
Later on, in another file, I import that api and do the upload, using Images.insert({
and then use the upload.on('end', function
to get it uploaded. I'm guessing that is where I'm missing saving the file to my filesystem? Hopefully this helps and provides more detail for debugging. Also, when I do have a FileCursor
object, I try the link()
method and it just returns link is not a function
. I basically just followed the Meteor Files GitHub Example.
--- EDIT 2 ---
As pointed out by @Rolljee, I had other packages that were still in my project that I hadn't removed. They were interfering and causing this to not work.
...ANSWER
Answered 2018-Jan-14 at 19:46Usually static assets are kept under public in your app structure, so public/images/picture.jpg is available as /images/picture.jpg in your HTML.
Unfortunately you can't save uploaded files to this directory (you probably know that), so another strategy is needed.
You don't say whether your problem is in development or production.
The sample code uses - which means that the package will provide a url for you, based on the configuration. Does this not work? If you are formulating your own url, and you are going to deploy to mobile, the URL will need to be absolute, not relative, because of the way mobile apps run with a local web server for local assets.
This may not be a complete answer (yet), but if you can provide more information we can get there
QUESTION
I am connecting to some remote collections via the following pattern:
...ANSWER
Answered 2017-Dec-11 at 23:34Looking at the source of Meteor-Files, the Mongo.Collection
is added in lines 126-130 of server.js
and lines 73-77 of client.js
without any options being passed in.
What you can do is pass your own RemoteCollection
into the FilesCollection
constructor and the collection will use your collection and it's remote.
QUESTION
I am trying to implement file uploads for meteor using Method call.
I am using this meteor package: https://atmospherejs.com/ostrio/files.
I have no problem on client side (I can send file in a base64 encoded format). on server side I am trying to implement this function : https://github.com/VeliovGroup/Meteor-Files/blob/master/docs/write.md
but I am getting this error.
...ANSWER
Answered 2017-Nov-20 at 02:12According to the lib documentation you will need to first instantiate Images
with an instance of FilesCollection
, similar to as following:
https://github.com/VeliovGroup/Meteor-Files#api-overview-full-api
QUESTION
- Users register and all data is in the collection "users" (meteor useraccounts).
- In the profile page a user can upload a profile picture (meteor-files). The picture metadata is registered in the collection 'images'.
Everyone is allowed to browse the profiles and it works very well except i need to dynamically change the src link for the profile picture on each card displaying. I'm not sure how to go about this when the information i need is in another collection.
images collection:
...ANSWER
Answered 2017-Jun-25 at 18:15Meteor.userId()
will return the current _id
of the user if he is logged in.
So your mongo query should be:
QUESTION
I am using https://github.com/VeliovGroup/Meteor-Files, This package provide a collection of uploaded files via Meteor-Files.
How can I insert a document about the file that is already uploaded and not via Meteor-Files? I want to use Meteor-Files to save file info only not uploading. Because I need to get a generated download link for the file. This is provided by Meteor-Files.
Anyone can help me guide how to solve this problem?
...ANSWER
Answered 2017-Jun-05 at 10:00I used addFile() function provided by FilesCollection class.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Meteor-Files
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page