Looking for very simple file upload example?

Hi, I didn’t read the thread but based on the title here are 2 of my repositories of simple upload integration with Slingshot and CollectionFS


might be useful

@wesyah234 I downloaded the fileUploadDemo from github was was running fine on my end and does not show as @klim observed.

However, even though I can see the files on {path: "~/meteor_uploads"} that I uploaded, restarting the server will somehow delete all these files. DO you have any idea?

Woa, that is very strange… I hadn’t noticed it doing that, but I will give it a try on Monday and check for sure.

i think i know the reason… {path: “~/meteor_uploads”} is inside the .meteor folder. i tried to another location outside from the .meteor and it’s all okay now =)

ahh… that’s interesting… didn’t realize it did that. I thought ~ meant the user’s home directory, not the .meteor folder…

Hi @ralpheiligan
I have the same issue… files under "~/somefolder disappear on restart:
How did you specify {path:…} to be outside of .meteor folder and still accessible
from within a meteorapp ?

@noveltysa I am using a windows in development so here’s what I did.

 DocFiles = new FS.Collection("docfiles", {
      stores: [new FS.Store.FileSystem("docfiles", {path: "D:/meteor_uploads"})]
    });

Wow…!
@ralpheiligan This works great… on windows thanks :smile:

My development is on windows…
production ver. will be deployed in ubuntu 14.04,… so if it works on win should work in ubuntu

Thanks.

pleasure to help others =)

Hi @ralpheiligan,
Could you help me figure out how can I directly upload a picture (took from camera) to server?
I mean, I can take a picture (raw data) and show them to view, but I don’t want to save to and then upload the file, just directly upload would be nice.
Thanks in advanced!
MNChau.

I have not tried what you are asking for… can you get hold of the file after taking the picture because that will be a good start

Thanks for quick response,
This is what I could get the ‘data’:

Template.takePhoto.events({
    'click .capture': function () {
        MeteorCamera.getPicture({}, function (error, data) {
            Session.set('photo', data);
        });
    }
});

And then I show it in the view:

    

Could I directly send that “data” to server? and how?

are you using/going to use FSCollection or directly to mongodb?

Honestly, I didn’t know which is the best way.
I want to make an app like social network, where people could upload their avatar (from file or from camera), photo and videos. Right now, I think about store it in my local server and then later to production (maybe) would be a cloud server.