在 scriptdata 下,在 fileext 中如何指定允许的文件类型?
例如:
$('#file_mainfile').uploadify({
'uploader' : '<?php echo WPDEPOSIT_URL; ?>/resources/js/uploadify/uploadify.swf',
'script' : '<?php echo $uploadPath; ?>',
'cancelImg' : '<?php echo WPDEPOSIT_URL; ?>/resources/images/cancel.png',
'folder' : '<?php echo $fileFolder; ?>',
'auto' : true,
'fileExt' : '*.zip',
'buttonText': '<?php _e('Upload .zip', WPD_SHOPPER_NAME); ?>',
'method' : 'post',
<?php if(WPDS_AMAZONS3_ACTIVE == 'on'): ?>
'fileDataName' : 'file',
'auto' : 'true',
'scriptData' : {
"AWSAccessKeyId" : "<?php echo $amazonClass->AWS_ACCESS_KEY; ?>",
"key" : "${filename}",
"acl" : "public-read",
"policy" : "<?php echo $policy; ?>",
"signature" : "<?php echo $signature; ?>",
"success_action_status" : "201",
"key" : encodeURIComponent(encodeURIComponent("<?php echo $folder; ?>${filename}")),
/* here ----> */ "fileext" : encodeURIComponent(encodeURIComponent("")),
"Filename" : encodeURIComponent(encodeURIComponent(""))
},
我实际上已经指定了允许的扩展名;'fileExt' : '*.zip',
. 但我仍然可以上传其他文件类型。