jalik / meteor-jalik-ufs

Upload File System for Meteor **DISCONTINUED**
MIT License
99 stars 29 forks source link

How to upload to store on another meteor server? #88

Open vacarsu opened 8 years ago

vacarsu commented 8 years ago

I have two meteor servers and I'm connecting. One for the desktop app with all the collections, and the other for the mobile app. I'm connecting the mobile app to the desktop app via ddp.connect(). How can I upload files to the store on the meteor server hosting the desktop app and database? If I try I get Store not found [invalid-store]. If I define the store on the server of the mobile app it tries to send a post request to http://localhost:3000/ufs/appimages/ which should be http://localhost:3030 where the database is located.

Here is my collection on the mobile server
imports/collections/app-images.ts
    import { Meteor } from 'meteor/meteor';
    import { Mongo } from 'meteor/mongo';
    import { UploadFS } from 'meteor/jalik:ufs';
    import { CloudServer } from './../cloud-connection';

    export const AppImages = new Mongo.Collection('appimages', {
      connection: CloudServer
    });

    export const AppImagesStore = new UploadFS.store.GridFS({
      collection: AppImages,
      name: 'appimages',
      filter: new UploadFS.Filter({
        contentTypes: ['image/*']
      })
    });
andypopa commented 7 years ago

In my case, I forgot to add this import in /server/main.js

import '../imports/api/images';