uploadify フォーラムでの提案を含む、さまざまな提案を試みました: http://www.uploadify.com/forum/#/discussion/8232/upload-five-html-5-file-type-filter-capability/ p1
しかし、これらはユーザーがファイルの種類を変更することを制限しているようには見えません。何か案は?これは以下の私のコードです:
<script type="text/javascript">
<?php $timestamp = time();?>
$(function() {
if ($('#fileupload').length > 0) {
$('#fileupload').uploadifive({
'auto' : true,
'checkScript' : '../home/assets/uploadifive/check-exists.php',
'formData' : {
'timestamp' : '<?php echo $timestamp;?>',
'token' : '<?php echo md5('unique_salt' . $timestamp);?>'
},
//'queueID' : 'queue',
'uploadScript' : '../home/assets/uploadifive/uploadifive.php',
'multi' : false,
'removeCompleted' : false,
'fileSizeLimit' : '3MB',
'uploadLimit' : 1,
'buttonText':'Select File',
onSelect: function() {
$('#btn_submit').attr({disabled: true, value:'Uploading...' }).css( "background-color", "#707070" );
},
onUploadComplete: function(file,data,reponse) {
$('#uploadedfile').val(data);
$("#btn_submit").attr({disabled: false, value:'Register' }).css( "background-color", "#D4D0C8" );
alert('The file ' + file.name + ' was successfully uploaded ');
},
// 'fileType' : 'application/pdf|application/doc|application/docx' //not
//working.
// 'fileType' : ["gif","jpeg","png"] //not working.
// 'fileType' : 'image/png|image/jpg' //not working.
// 'fileType' : 'image/*' // works but does not restrict user from changing
// it something else.
// 'fileType': ["image\/jpeg","image\/png"] // works but does not restrict user
// from changing it something else.
});
}
});
</script>