[Work-around found] Ostrio:files files not included in build

I’m using meteor 1.5. Everything works locally.
I have an /assets/plans directory that isn’t being packaged up in my server build

  • assets
  • client
  • server

ostrio:files prefers that the images are relative to the “Assets” directory, I put them all in there.

FloorplanImages = new FilesCollection({
  collectionName: 'FloorplanImages',
  storagePath: './plans/',
  allowClientCode: false, // Disallow remove files from Client
  onBeforeUpload(file) {
    // Allow upload files under 10MB, and only in png/jpg/jpeg formats
    if (file.size <= 10485760 && /png|jpg|jpeg/i.test(file.extension)) {
      return true;
    } else {
      return 'Please upload image, with size equal or less than 10MB';

    var plan = Floorplans.findOne({_id: Session.get("selected_floorplan_id")});
    var bounds = [xy(0, 0), xy(plan.picwidth, plan.picheight)];
    var planimage = FloorplanImages.findOne({name: plan.picname});
    if(typeof planimage != 'undefined') {
      if(image != "") { map.removeLayer(image) };
	    image = L.imageOverlay(planimage.link(), bounds).addTo(map);
      map.setView(xy(plan.picwidth/2, plan.picheight/2), 0);
      console.log("No floorplan image found");

I get “no floorplan image found”

when I look for one of the files in the bundle directory:

find ./ -name Electrical-1.png -print

I get no results. This tells me they are not getting packaged. Any ideas?

I tried downgrading to Meteor v1.4.4.3, but alas, still no joy.

Still wondering what is going wrong. I’m willing to give someone access to the bitbucket repo if they are willing to help. Just let me know if you are interested.

I am in a time crunch (need the app tomorrow). If anybody is interested in making some $$ to help fix this problem, please let me know by responding to this post

Can anybody tell me why my assets directory wouldn’t be included in the build?

Well, I found a work-around (unless this is the intended functionality of this library).

I setup the storagePath as a variable in Meteor.settings

  • for local, it’s set to ./plans
  • for production, it’s set to /home/sid/plans

After copying the build to the server, I then copied the plans directory to /home/sid/ manually.

Seems to work.

1 Like

I know it’s late, but anyways:

All files uploaded locally would not be transferred/packed into the build, moreover if files stored under Meteor project’s directory it will be erased every time meteor rebuilds the app, from FAQ:

Note: All files will be removed as soon as your application rebuilds or you run meteor reset. To keep your storage persistent during development use an absolute path outside of your project folder, e.g. /data directory.