Skip to content

Adding hooks #61

Open
Open
@jankapunkt

Description

@jankapunkt

I have a suggestion:

I am still using this and I came to some limits I'd like to solve with some hooks:

picture: {
  type: String,
  autoform: {
    afFieldInput: {
      type: 'fileUpload',
      collection: 'Images',
      hooks: {
        onProgress: () => {}, // while in progress
        onComplete: () => {}, // progress === 100%
        onError: err => {}, // there was an upload error
        onRemove: fileId => {}, // user wants to delete the uploaded file
        onRemoved: () => {}, // the file has been removed
      }
    }
  }
}

The reasons are simple:

  • disable form submit/cancel until file has been uploaded
  • let users remove their uploaded file by using a custom Meteor method (because the default remove is disabled)
  • custom way of communicating upload errors to the user

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions