Foros del Web » Programando para Internet » Javascript » Frameworks JS »

Extjs, hacer un upload de archivo

Estas en el tema de Extjs, hacer un upload de archivo en el foro de Frameworks JS en Foros del Web. Hola a todos :) Estoy tratando de hacer un upload de archivos, y para ello utilizo la libería de javascript, Extjs con PHP.... creo un ...
  #1 (permalink)  
Antiguo 03/09/2014, 22:50
Avatar de Ludwingg  
Fecha de Ingreso: diciembre-2002
Ubicación: San Salvador
Mensajes: 951
Antigüedad: 21 años, 4 meses
Puntos: 5
Extjs, hacer un upload de archivo

Hola a todos :)

Estoy tratando de hacer un upload de archivos, y para ello utilizo la libería de javascript, Extjs con PHP.... creo un formulario, este tiene el tipo de campo xtype: fileuploadfield... al dar click a un boton, hago un envío a mi archivo php, para generar un Json..... el problema es que hace el envío de todos los textfield del formulario, excepto el fileuploadfield.... aqui esta mi codigo:

Código:
this.formAdd = new Ext.FormPanel({
				fileUpload:true,
				border:false,
				items:[{
					layout:'absolute', xtype:'form', border:true, width:490, height:300, id:'actividadPer', bodyStyle:'padding-bottom:10px;',
					url:'jr_dirweb_store.php', 
					defaults:{ layout:'form',labelWidth: 50, labelAlign:'top', bodyStyle:'padding-right:10px;padding-left:10px', border:false },
					items:[
						{ x:0, y:10, items:[{ xtype:'textfield', fieldLabel:'<b>URL</b>', width:460, name:'txtUrl', itemId:'txtUrl',id:'txtUrl',allowBlank:false, vtype:'url',emptyText:'http://' }] },
						{ x:0, y:60, items:[{ xtype:'textfield', fieldLabel:'<b>Etiquetas (Español)</b>', width:460, name:'tagses', itemId:'tages',id:'tagses',allowBlank:false }] },
						{ x:0, y:110, items:[{ xtype:'textfield', fieldLabel:'<b>Tags (English)</b>', width:460, name:'tagsen', itemId:'tagsen',id:'tagsen',allowBlank:false }] },
						{ x:0, y:160, items:[{ xtype: 'fileuploadfield', emptyText: '<?=Title_seleccionar?>', fieldLabel:'<b><?=Title_imagen?></b>', name: 'iconox',id: 'iconox', buttonText:'<?=Title_examinar?>', width:460, allowBlank: false}]},
						{ x:0, y:210, items:[{ xtype:'combo', id:'idiomax', fieldLabel:'<b><?=Title_idioma?></b>', forceSelection: true, store: store_combo_cats, width: 150, triggerAction: 'all', editable:false, valueField:'id', displayField:'leng', lastQuery: ''}]},
						{ x:200, y:210, items:[{ xtype:'combo', name:'plataformax', id:'plataformax', fieldLabel:'<b><?=Title_junior81?></b>', forceSelection: true, store:store_combo_apps, width: 150, 
		triggerAction: 'all', editable:false, valueField:'id', displayField:'nombre', mode:'local'}]}

					],
					guardar:function(){
						if (Ext.getCmp('actividadPer').getForm().isValid()) { // Validamos el formulario
							Ext.getCmp('actividadPer').getForm().submit({ url: 'jr_dirweb_store.php', method: 'POST', params:{pedido:'agregar'},
								success: function(form, action){ 
									Ext.example.msg('<?=Title_guardado?>','<?=Title_adminwebteca16?>'); 
									Ext.getCmp('actividadPer').getForm().reset();
									ventanaW.ventNew.close();
									storegrid.removeAll();
									storegrid.reload();
								},
								failure:function(form, action){
									Ext.example.msg('<?=Title_error?>','Error'); 
									Ext.getCmp('actividadPer').getForm().reset();  
								}
							});
						}else{ Ext.example.msg('<?=Title_informacion?>','<?=Title_adminwebteca15?>'); }
					}
				}]
			});
Y el handler para hacer el envío:
Código:
buttons:[						
							{
								text:'<?=Title_guardad?>',
								handler:function(){ 
									Ext.getCmp('actividadPer').guardar(); 
								}
							}
						]
Observen esta linea:
Código:
{ x:0, y:160, items:[{ xtype: 'fileuploadfield', emptyText: '<?=Title_seleccionar?>', fieldLabel:'<b><?=Title_imagen?></b>', name: 'iconox',id: 'iconox', buttonText:'<?=Title_examinar?>', width:460, allowBlank: false}]}
Esa es la que no se envía :(

Gracias por cualquier ayuda.
  #2 (permalink)  
Antiguo 04/09/2014, 08:52
Avatar de Ludwingg  
Fecha de Ingreso: diciembre-2002
Ubicación: San Salvador
Mensajes: 951
Antigüedad: 21 años, 4 meses
Puntos: 5
Respuesta: Extjs, hacer un upload de archivo

Alguna idea?

Etiquetas: extjs, formulario, javascript, js, php, select, upload
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:43.