yogiben / meteor-autoform-file

Upload and manage files with #autoForm
MIT License
92 stars 101 forks source link

Internet explorer #85

Open advany opened 8 years ago

advany commented 8 years ago

In both internet explorer and firefox, no file dialogue is triggered. Here is an example:

http://islamagenda.nl/events/create

Use a very simple implementation (and no error)

advany commented 8 years ago

switched to the old version (before jquery fileupload) and it works! How can I debug it.. because I can't figure it out.

mperkh commented 8 years ago

+1

takahser commented 8 years ago

+1

macmacs commented 8 years ago

+1 Same Problem here. No Errors are thrown ... just doesn't work. Please look into fixing it, THANKS!

advany commented 8 years ago

I think I know the problem, its the missing iframe plugin. Ill try to create an fix.

macmacs commented 8 years ago

@advany GREAT! Thanks man!

advany commented 8 years ago

Little busy, btw an easy fix is:

meteor remove yogiben:autoform-file meteor add shinn:autoform-file

isbjorn commented 8 years ago

We can not have <input type=file> inside <button>:

http://www.w3.org/TR/html5/forms.html#the-button-element:

4.10.8 The button element Content model: Phrasing content, but there must be no interactive content descendant. ---> Interactive content is content that is specifically intended for user interaction. ⇒ a, audio...

Fix is to replace button with span (tested in chrome & firefox)

Anybody can use code like this:

<template name="afFileSelectFileBtnTemplateFixed">
  <span class="btn btn-default af-select-file js-af-select-file">
    {{label}}
    <input type="file" class="js-file" accept="{{accept}}">
  </span>
</template>
// client.js
Template.afFileSelectFileBtnTemplateFixed.onRendered(function () {

  $('.js-file').fileupload();
})

And use selectFileBtnTemplate inside schema:

...
  avatar: {
    type: String,
    autoform: {
      afFieldInput: {
        type: 'fileUpload',
        collection: 'Images',
        selectFileBtnTemplate: 'afFileSelectFileBtnTemplateFixed',
        label: 'Choose file',
        accept: 'image/*',
      },
    },
  },
...
mario589736 commented 8 years ago

When i use this bugfix i get the following error:

TypeError: $(...).fileupload is not a function

When i use a not Custom Button, Fileupload Dialog is not opened after clicking the Button.

bulleric commented 8 years ago

i also don't get a working version have somebody find out more?

isbjorn commented 8 years ago

@mario589736 @bulleric

I created simple page for testing upload button: http://oa-testupload.meteor.com Checked it with chrome, firefox, ie11, edge (only file selection is worked, upload is disabled by code)

You can reproduce this page with instructions from: https://github.com/isbjorn/test-upload

mario589736 commented 8 years ago

@isbjorn Thanks!!!!! Its working!