File Upload on Modal Dialog

79 views
Skip to first unread message

Perry Mark Guinjicna

unread,
May 20, 2015, 8:03:52 AM5/20/15
to jquery-f...@googlegroups.com
Hi,

I am hoping you could help me with my problem.

I am using bootbox.js a bootstrap modal dialog and I would like to add the fileupload on the modal dialog.
It doesn't seem to be working. I am using the basic script

var url = window.location.hostname === 'localhost' ?
'//fileupload/' : 'server/php/';
$('#fileupload').fileupload({
url: url,
dataType: 'json',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo('#files');
});
},
progressall: function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
);
}
}).prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');


Do I need to tweak some stuffs in order for this to work?



Thanks,
Perry
Reply all
Reply to author
Forward
0 new messages