Authored by weiqingting

提交

... ... @@ -161,9 +161,12 @@ edit.prototype={
// $(this).attr("value",response.data);
// }
// });
if(!that.option.bucket){
alert("bucket不存在");
}
$('input[type="file"]',that.el).ajaxfileupload({
'action': '/ajax/upload',
'params':{"userId":543883,"bucket":that.option.bucket||'smart',__type:"upload"},
'params':{"userId":543883,"bucket":that.option.bucket,__type:"upload"},
'onComplete': function(response) {
if(response.status&&response.code==200){
var _w=$(this).next().find('.fileinput-button-icon');
... ...
... ... @@ -18,6 +18,7 @@ $.fn.ajaxfileupload = function(options) {
$.extend(settings, options);
}
return this.each(function() {
var $element = $(this);
if ($element.data('ajaxUploader-setup') === true) return;
... ... @@ -27,6 +28,12 @@ $.fn.ajaxfileupload = function(options) {
if (ext) {
settings.valid_extensions = ext.split(',');
}
var bucket = $element.attr("bucket");
if(bucket){
settings.params.bucket=bucket;
}
console.log(settings.params);
$element.change(function() {
uploading_file = false;
if (settings.submit_button == null) {
... ...
... ... @@ -157,7 +157,7 @@
<!-- Mov avi rmvb mp4 -->
<div class="row">
<div id="upload-wrapper1" class="col-md-3">
<input id="videofile" name="videofile" type="file" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}">
<input id="videofile" name="videofile" type="file" bucket="goodsvideo" extend="mp4,rmvb,avi,mov" class="btn btn-primary ml10" value="{attachUrl}">
</div>
<div class="col-md-9">
<div class="row">
... ...