meteor-admin icon indicating copy to clipboard operation
meteor-admin copied to clipboard

can not upload attachment

Open myheren opened this issue 9 years ago • 11 comments

I used meteor-starter project and in it I can not upload attachment of posts, as in the picture t1

myheren avatar Jul 01 '15 18:07 myheren

+1, looks like quickform is broken?

reduxdj avatar Jul 03 '15 15:07 reduxdj

in your posts.coffee file: https://github.com/yogiben/meteor-starter/blob/13efb700d9f8c417070234c54f868ab76fad8323/collections/posts.coffee

you need to add between line 27-28: optional:true

just like how the updatedAt field has it on line 21

mordrax avatar Jul 06 '15 04:07 mordrax

I changed my model to Articles rather than posts:

That does not help setting optional:true in the schema still does not work, nothing happens in the UI when i goto insert an image into article from /admin/Articles/new - image upload does not work from this template,

However, when I goto my custom /article/new template it works fine. Can you fix the admin tool to make image upload work please?

reduxdj avatar Jul 06 '15 15:07 reduxdj

I can confirm it doesn't work with 1.2.0. It does work with 1.2.1 however which should be released today.

mpowaga avatar Jul 07 '15 13:07 mpowaga

That's reassuring

reduxdj avatar Jul 07 '15 15:07 reduxdj

It's already on atmosphere. You can check it out.

mpowaga avatar Jul 07 '15 18:07 mpowaga

1.2.1 still fails out of the box for me.

2http-call-client.js:101 The provided value 'undefined' is not a valid enum value of interface XMLHttpRequestResponseType. fsFile-common.js:46 Uncaught Error: FS.File.attachData requires a data argument with some datafsFileAttachData @ fsFile-common.js:46FS.Collection.insert @ api.common.js:81Template.afFileUpload.events.change .js-file @ autoform-file.coffee:51(anonymous function) @ template.js:463Template._withTemplateInstanceFunc @ template.js:437(anonymous function) @ template.js:462(anonymous function) @ view.js:869Blaze._withCurrentView @ view.js:523(anonymous function) @ view.js:868(anonymous function) @ events.js:47jQuery.event.dispatch @ jquery.js:4665jQuery.event.add.elemData.handle @ jquery.js:4333

reduxdj avatar Jul 11 '15 16:07 reduxdj

Even supplying my own template results in the same problem.. while that template works with upload by itself.

reduxdj avatar Jul 12 '15 00:07 reduxdj

The problem seems to be do a missing subscription in the meteor starter app where i started this app from....

Meteor.subscribe('attachments') solved the problem for me.

reduxdj avatar Jul 16 '15 01:07 reduxdj

Yep, also solved for me...

Router.waitOn ->
  [
    subs.subscribe 'user'
    subs.subscribe 'attachments'
  ]

at router.coffee

jlourenco avatar Sep 10 '15 11:09 jlourenco

Works in Chrome and Safari but still does not work in Firefox :-/

headkit avatar Oct 20 '17 11:10 headkit