Extjs-多上传文件
我使用PHP处理单个上载文件非常好。现在我正在处理多上传文件Extjs-多上传文件,extjs,file-upload,upload,extjs4.1,Extjs,File Upload,Upload,Extjs4.1,我使用PHP处理单个上载文件非常好。现在我正在处理多上传文件 我发现了一个问题,也许这是我找到的最好的多上传文件。我的代码在这里 但我不知道php文件是怎么写的 谁能告诉我一个php文件上传多个文件以上非常感谢:) 编辑: 我下面的代码将上载最后一个文件(不是多个文件:()。如何上载多个文件谢谢 <?php if(isset($_FILES['fileuploadfield-1017-inputEl'])) { $file_name = $_FILES['fileu
我发现了一个问题,也许这是我找到的最好的多上传文件。我的代码在这里 但我不知道php文件是怎么写的
谁能告诉我一个php文件上传多个文件以上非常感谢:) 编辑:
我下面的代码将上载最后一个文件(不是多个文件:()。如何上载多个文件谢谢
<?php
if(isset($_FILES['fileuploadfield-1017-inputEl'])) {
$file_name = $_FILES['fileuploadfield-1017-inputEl']['name'];
$file_tmp =$_FILES['fileuploadfield-1017-inputEl']['tmp_name'];
move_uploaded_file($file_tmp,$file_name);
echo "{success:true}";
}else {
echo "{failure:true}";
}
?>
Ext.define('Ext.ux.form.MultiFile'{
扩展:“Ext.form.field.File”,
别名:“widget.multifilefield”,
initComponent:函数(){
var me=这个;
me.on('render',function(){
me.fileInputEl.set({multiple:true});
});
me.callParent(参数);
},
onFileChange:函数(按钮、e、值){
this.duringFileSelect=true;
var me=这个,
upload=me.fileInputEl.dom,
files=upload.files,
名称=[];
如果(文件){
对于(var i=0;i
ExtJS 4.2.2的多个上传的实时演示是
<?php
if(isset($_FILES['fileuploadfield-1017-inputEl'])) {
$file_name = $_FILES['fileuploadfield-1017-inputEl']['name'];
$file_tmp =$_FILES['fileuploadfield-1017-inputEl']['tmp_name'];
move_uploaded_file($file_tmp,$file_name);
echo "{success:true}";
}else {
echo "{failure:true}";
}
?>
Ext.define('Ext.ux.form.MultiFile', {
extend: 'Ext.form.field.File',
alias: 'widget.multifilefield',
initComponent: function () {
var me = this;
me.on('render', function () {
me.fileInputEl.set({ multiple: true });
});
me.callParent(arguments);
},
onFileChange: function (button, e, value) {
this.duringFileSelect = true;
var me = this,
upload = me.fileInputEl.dom,
files = upload.files,
names = [];
if (files) {
for (var i = 0; i < files.length; i++)
names.push(files[i].name);
value = names.join(', ');
}
Ext.form.field.File.superclass.setValue.call(this, value);
delete this.duringFileSelect;
}
});