nervgh/angular-file-upload

How to hide the input element and trigger the file upload with another control

VosWouter87 opened this issue · 1 comments

Using a custom upload button and/or drag-n-drop area and custom upload function
When trying to implement this control into my site, I get the following error: 'TypeError: "Uploader" must be an instance of FileUploader'
When I can't use the provided uploader.
I've tried using the FileUploader, this doesn't help.
After choosing a file, my ng-model value hasn't changed, and thus my ng-change event won't trigger.

I've tried making a JSFiddle to demonstrate this, but it keeps failing with the error "Error: [$injector:nomod] Module 'app' is not available!"
When I've clearly registered app with:

var app = angular.module('app', [
    'angularFileUpload'
]);

When using the code on my site it does properly change the file name on the control itself. If I leave the control visible. But I can't use the default file upload button and want it to remain hidden. Instead I need a custom upload button and function.

I'm using version 2.5.0 of the control

ygj6 commented

@VosWouter87 You can refer to the ygj6@dc92cb7. It supports custom upload buttons and also supports dragging files.
Hope that can help you.