Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Plupload in a Angularjs $modal and the select files button doesn't work #1513

Open
hunny-sketch opened this issue Sep 15, 2017 · 1 comment

Comments

@hunny-sketch
Copy link

hunny-sketch commented Sep 15, 2017

I use the following method to open a dialog using angularjs $modal:

$scope.uploadFile = function(){
	var modalInstance = $modal.open({
		template: 'fileUploadDialog.html',
		controller: 'FileUploadController'
	});
};

And my controller looks like this:

app.controller('FileUploadController', function($scope){
	$scope.uploader = new plupload.Uploader({
		runtimes : 'html5,flash,silverlight,html4',
                browse_button: 'uploadBtn', 
                url: '/upload',
                filters: {
                    mime_types : [ 
                        { title : "Image files", extensions : "jpg,gif,png" }
                    ],
                    max_file_size : '2mb',
                    prevent_duplicates : true 
                }
	});
	$scope.uploader.init();
});

But, there is neither any response nor any kind of error when i click on the browse button。How can i fix it?
Thank you!

@jayarjo
Copy link
Contributor

jayarjo commented Sep 18, 2017

When your modal is ready, rendered and visible, try to call uploader.refresh().

You should have a handler attached to error event to capture one if it occurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants