SwfUpload动态上传目录
onchange listbox 事件
var url='';
$('#vendor').change(function(){
var optionVal = $(this).val();
if (optionVal=='') {
url="";
} else {
url="../uploads/users/"+optionVal+"/items/";
}
});
我需要动态更改上传目录
swfu = new SWFUpload({
upload_url: "../functions/class_uploads.php?action=general&destination=" + **url**,
post_params: form_parameter,
file_post_name: "Filedata",
file_size_limit: "10 MB",
file_types: "*.jpg;*.gif;*.png;*.bmp;*.flv;",
file_types_description: "Doar fisiere: .jpg, .gif, .png, .bmp, .flv",
file_upload_limit: "10",
file_queue_limit: "0",
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
swfupload_loaded_handler: swfuploadLoaded,
file_dialog_start_handler: fileDialogStart,
file_queued_handler: fileQueued,
file_queue_error_handler: fileQueueError,
upload_start_handler: uploadStart,
upload_progress_handler: uploadProgress,
upload_success_handler: uploadSuccess,
button_image_url : "../Styles/static/images/uploads/smallspyglass.png",
button_placeholder_id : "spanButtonPlaceHolder",
button_width: 180,
button_height: 18,
button_text : "<span class=\"button\">File<span class=\"buttonSmall\"><\/span><\/span>",
button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
button_text_top_padding: 0,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
flash_url : "../js/uploads/flash/swfupload.swf",
flash9_url : "../js/uploads/flash/swfupload_FP9.swf",
custom_settings : {
upload_dir : **url**,
thumb : "../functions/class_thumbnail.php",
progressTarget: "fsUploadProgress",
thumbTarget: "thumbPreview",
cancelButtonId: "btnCancel",
filesQueuedCount:"10",
fileUploadNumber:"",
delete_url: "../functions/class_delete.php",
delete_url_error: "../functions/class_delete.php",
submit_btn: "btn_submit",
pkd: 1271043206,
image_upload: 0,
mixt_upload: 1 },
debug: false
});
onchange listbox event
var url='';
$('#vendor').change(function(){
var optionVal = $(this).val();
if (optionVal=='') {
url="";
} else {
url="../uploads/users/"+optionVal+"/items/";
}
});
I need dynamicaly change upload directory
swfu = new SWFUpload({
upload_url: "../functions/class_uploads.php?action=general&destination=" + **url**,
post_params: form_parameter,
file_post_name: "Filedata",
file_size_limit: "10 MB",
file_types: "*.jpg;*.gif;*.png;*.bmp;*.flv;",
file_types_description: "Doar fisiere: .jpg, .gif, .png, .bmp, .flv",
file_upload_limit: "10",
file_queue_limit: "0",
swfupload_preload_handler : preLoad,
swfupload_load_failed_handler : loadFailed,
file_queue_error_handler : fileQueueError,
file_dialog_complete_handler : fileDialogComplete,
upload_progress_handler : uploadProgress,
upload_error_handler : uploadError,
upload_success_handler : uploadSuccess,
upload_complete_handler : uploadComplete,
swfupload_loaded_handler: swfuploadLoaded,
file_dialog_start_handler: fileDialogStart,
file_queued_handler: fileQueued,
file_queue_error_handler: fileQueueError,
upload_start_handler: uploadStart,
upload_progress_handler: uploadProgress,
upload_success_handler: uploadSuccess,
button_image_url : "../Styles/static/images/uploads/smallspyglass.png",
button_placeholder_id : "spanButtonPlaceHolder",
button_width: 180,
button_height: 18,
button_text : "<span class=\"button\">File<span class=\"buttonSmall\"><\/span><\/span>",
button_text_style : '.button { font-family: Helvetica, Arial, sans-serif; font-size: 12pt; } .buttonSmall { font-size: 10pt; }',
button_text_top_padding: 0,
button_text_left_padding: 18,
button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
button_cursor: SWFUpload.CURSOR.HAND,
flash_url : "../js/uploads/flash/swfupload.swf",
flash9_url : "../js/uploads/flash/swfupload_FP9.swf",
custom_settings : {
upload_dir : **url**,
thumb : "../functions/class_thumbnail.php",
progressTarget: "fsUploadProgress",
thumbTarget: "thumbPreview",
cancelButtonId: "btnCancel",
filesQueuedCount:"10",
fileUploadNumber:"",
delete_url: "../functions/class_delete.php",
delete_url_error: "../functions/class_delete.php",
submit_btn: "btn_submit",
pkd: 1271043206,
image_upload: 0,
mixt_upload: 1 },
debug: false
});
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在开始上传之前执行
swfu.setUploadURL('...');
。http://demo.swfupload.org/Documentation/#setUploadURL
Do
swfu.setUploadURL('...');
before starting the upload.http://demo.swfupload.org/Documentation/#setUploadURL