Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
projectn00b
@projectn00b
<template name="hello">
Add Files<br>
  <form class="input">
    <input type="text" id="theName" name="theName"/>
    <span class="btn btn-default btn-file">
      <input multiple class="file fileInput" type="file"/>
    </span>
  <input type="submit" value="Add To Collection"/>
  </form>
<br>
  {{#each uploads}}
<br>
  User: {{email}}
<br>
  Filename: {{name}}
<br>
  Description: {{theName}}
<br>
  <a class="btn btn-primary" href="{{url download=true}}">Download</a>
<br>
{{/each}}

</template>
projectn00b
@projectn00b
Template.hello.events({
  'submit form': function(event, template){
    event.preventDefault();
    var theName = event.target.theName.value;
    FS.Utility.eachFile(event, function(file){
      var currentUserId = Meteor.userId();
      var fileObj = new FS.File(file);
      fileObj.itemtext = theName;
      fileObj.userId = currentUserId;
      fileObj.email = Meteor.user().emails[0].address;
      Uploads.insert(fileObj, function(err){
        console.log(err);
      })
   })
  } 
Mitchell Barron
@mtchllbrrn
I'm looking to download & parse large CSVs, on the order of 1 million+ rows. I'm worried about memory consumption & handling disconnects. Does CollectionFS offer a good solution for this use-case?
Daniel Lamando
@danopia
i don't see anything in the README about enabling caching for CFS-served images. am i missing something?
projectn00b
@projectn00b
Anyone have a clue why 127.0.0.1:3000/images/whatever.png shows up but 127.0.0.1:3000/images/thumbs/whatever.png would give me a 404? I am using cfs:s3 . would it be something with iron router ?
Daniel Lamando
@danopia
what are you expecting that to do?
if you are using multiple stores, your url should be /images/whatever.png?store=thumbs
demiantriebl
@demiantriebl
i cant change the path in windows with cfs:filesystem
any help?
the - path: "~/upload/images"; - don't work
YuraSrohiy
@YuraSrohiy

Hi all, have a strange problem

var image = Images.findOne({_id: photo._id});
var url = image.url("Images");
console.log(image);
onsole.log(image.url("Images"));

url method returns null, but when i set a timeout it returns url (image displays fine)
anybody knows where is a problem?

Florian Mettetal
@Falieson
@YuraSrohiy I am seeing the same problem, would think synchronous nature of meteor would prevent the requirement of a timeout (which I'm assuming is waiting for the db)
Pubudu Kodikara
@THPubs
Hi everyone! Im having a small issue with FS Collection
As soon as I create a new FS.Collection, my app crash throwing a MongoError: auth failed
I posted the full error log here : CollectionFS/Meteor-CollectionFS#874
Pubudu Kodikara
@THPubs
I just magaed to fix it by defining the mongo url but now getting Storage name already exists: "_tempstore" error
is it because i once used fs.filesystem and now using grdifs?
Pubudu Kodikara
@THPubs
Im als getting an error like this :
Error in method "/cfs/files/:value/:value/", Error: TypeError: Cannot read property 'images' of undefined
at Object.httpGetHandler (packages/cfs_access-point/packages/cfs_access-point.js:261:1)
at Object.accessPoint.get (packages/cfs_access-point/packages/cfs_access-point.js:594:1)
at packages/cfs_http-methods/packages/cfs_http-methods.js:582:1
projectn00b
@projectn00b
The provided value 'undefined' is not a valid enum value of type     XMLHttpRequestResponseType. cfs_upload-http.js:109 on trying to upload
Anyone?
santy
@santiq
@projectn00b do you set a name for the FS.File instance?
projectn00b
@projectn00b
What do you mean?
projectn00b
@projectn00b
@santiq can you give me an example?
santy
@santiq
@projectn00b yes, i had a similar problem
projectn00b
@projectn00b
@santiq Okay, what did you end up doing to fix it?
santy
@santiq
let file = new FS.File();
file.name( 'testing' );
file.attachData(blob,{},function(){
            Images.insert(file, (err, fileObj) => {} 
}
try something like that
projectn00b
@projectn00b
okay, thanks. I will try that right now.
projectn00b
@projectn00b
@santiq Uncaught ReferenceError: blob is not defined
what do you store in the blob?
projectn00b
@projectn00b
I used just the name part
and I am still getting The provided value 'undefined' is not a valid enum value of type XMLHttpRequestResponseType.
projectn00b
@projectn00b
I literally have my project 85% done until I realized that collectionfs wont do mobile uploads. I feel like an idiot for trying now.
Florian Mettetal
@Falieson
@projectn00b why do you think it won’t do mobile uploads?
projectn00b
@projectn00b
I think it is on the cordova side of things. It works in the browser but not in the mobile app. I am going to try and build the mobile app instead of just run it to the phone in dev mode. that might work. @Falieson
mgaffneyny
@mgaffneyny
hey all!
mgaffneyny
@mgaffneyny
anyone have an image gallery sample code I can run locally?
http://generator-upload.meteor.com/ - I found this but it uses meteor kitchen to generate it
I am having trouble with image display not showing up
I am missing something from upload, to store and display which is a problem
this should really be in the demo and show how to display images or files after upload
Cristian
@cristianst

Hello! Does anybody know if is it possible to change the file name before upload / inserting it in the collection ?
I want to rename the original file and use the id as name .

Ive tried something like this but seems not to be working

@ image manager for img upload
@ param fsCollection

FS.Utility.eachFile(event, function (formFile) {

                var fsFile = new FS.File(formFile);
                var fileId = fsFile._id;

                fsFile.name(fileId);
                fsFile.metadata = metadata;
                fsCollection.insert(fsFile, callback);
            });
Maximilian Beck
@glumb
Hey guys. I'm trying out meteor, its quite nice so far. One thing I dont really understand is how relations work. I'm used to work with ORMs. I created a Mongo.Collection 'items' and a FS.Collection 'images'. How can I add an image to the 'items' collection? I tried Items.insert({image: image}). This adds something, but I dont have the image functions like image.url availabel in the template.
Or in other words, how to extend the example https://github.com/Sanjo/collectionFS_test/tree/ejson-file-reference to show the uploaded images
Maximilian Beck
@glumb
Is the way to go to add a helper which fetches the Images?
Template.items.events({
    'change .myFileInput': function (event, template) {
        var files = event.target.files;
        for (var i = 0, ln = files.length; i < ln; i++) {
            var fileObj = Images.insert(files[i]);
            Items.insert({
                type:  'test',
                image: fileObj._id
            });
        }
    }
});
Template.item.helpers({
    image: function () {
        return Images.findOne(this.image)
    }
});
Cristian
@cristianst
this.image = imageId ?
projectn00b
@projectn00b
@cristianst .name