Note that there are some explanatory texts on larger screens.

plurals
  1. POmeteor mrt collectionfs deploy
    primarykey
    data
    text
    <p>I use collectionfs for storing files in my application.</p> <p>I copy+pasted most of the readme code provided with collectionfs into my application and also added the </p> <pre><code>{{cfsFileUrl "default1"}} </code></pre> <p>to my file listing. Everything works on my local machine.</p> <p>The problem arises when I deploy to ???.meteor.com with </p> <pre><code>mrt deploy ???.meteor.com </code></pre> <p>I can upload and download images and also a url is displayed from cfsFileUrl,</p> <p>BUT:</p> <p>When I access that url, I get Error 404.</p> <p>My code: client.html</p> <pre><code>&lt;body&gt; {{loginButtons}} {{&gt;queueControl}} &lt;br&gt;ta &lt;br&gt; {{&gt;fileTable}} &lt;/body&gt; &lt;template name="queueControl"&gt; &lt;h3&gt;Select file(s) to upload:&lt;/h3&gt; &lt;input name="files" type="file" class="fileUploader" multiple&gt; &lt;/template&gt; &lt;template name="fileTable"&gt; {{#each files}} {{cfsDownloadButton "ContactsFS" class="btn btn-primary btn-mini" content=filename}}&lt;br&gt; &lt;img src="{{cfsFileUrl "default1"}}"&gt; {{/each}} &lt;/template&gt; </code></pre> <p>client.js</p> <pre><code>ContactsFS = new CollectionFS('contacts', { autopublish: false }); Deps.autorun(function () { Meteor.subscribe('myContactsFiles'); }); Template.queueControl.events({ 'change .fileUploader': function (e) { var files = e.target.files; for (var i = 0, f; f = files[i]; i++) { ContactsFS.storeFile(f); } } }); Template.fileTable.files = function() { //show all files that have been published to the client, with most recently uploaded first return ContactsFS.find({}, { sort: { uploadDate:-1 } }); }; </code></pre> <p>server.js</p> <pre><code>ContactsFS = new CollectionFS('contacts', { autopublish: false }); Meteor.publish('myContactsFiles', function() { if (this.userId) { return ContactsFS.find({ owner: this.userId }, { limit: 30 }); } }); ContactsFS.allow({ insert: function(userId, file) { return userId &amp;&amp; file.owner === userId; } }); ContactsFS.fileHandlers({ default1: function(options) { // Options contains blob and fileRecord — same is expected in return if should be saved on filesytem, can be modified console.log('I am handling default1: ' + options.fileRecord.filename); console.log(options.destination()); return { blob: options.blob, fileRecord: options.fileRecord }; // if no blob then save result in fileHandle (added createdAt) } }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload