Extjs 4.1.1 RC2
When i upload a file, i receive an empty $_FILES in PHP
I have this form:
Code:
// Formulario para subir la foto
xtype: 'form',
name: 'formularioSubirFoto',
title: '',
bodyPadding: 5,
border: false,
anchor: '100%',
api: {
submit: Ext.esicontactosDirect.esicontactos_contactos.subirFotoContacto
},
items: [{
xtype: 'filefield',
name: 'fotocontacto',
fieldLabel: gt.dgettext('esicontactos','Foto'),
labelWidth: 50,
msgTarget: 'side',
allowBlank: true,
anchor: '100%',
buttonOnly: false,
buttonText: gt.dgettext('esicontactos','Seleccione una imagen...')
}]
And this is the submit process in mvc controller
Code:
formularioSubirFoto.getForm().submit({
params: {
cto_id: cto_id,
cto_guid: cto_guid
},
waitMsg: gt.dgettext('esicontactos','Subiendo foto al servidor ... '),
success: function(form, action) {
console.log("success");
},
failure: function(form, action) {
console.log("failure");
}
});
This is the php code that receives the extdirec api call
Code:
/**
* Subir la foto de un Contacto
* Este metodo tiene que estar agregado en la funcion esValido del esicontactos_uploader
* @remotable
* @formHandler
*/
public static function subirFotoContacto( $_parametros, $_archivos )
{
var_dump($_parametros);
var_dump("<br />");
var_dump($_archivos['fotocontacto']['tmp_name']);
var_dump("<br />");
var_dump($_archivos);
var_dump("<br />");
var_dump($_FILES);
var_dump("<br />");
...................
This is the post view in firebug
Code:
Encabezados de respuestaver fuente
Cache-Control |
no-store, no-cache, must-revalidate, post-check=0, pre-check=0 |
Connection |
close |
Content-Type |
text/html |
Date |
Tue, 04 Sep 2012 16:05:37 GMT |
Expires |
Thu, 19 Nov 1981 08:52:00 GMT |
Pragma |
no-cache |
Server |
Apache |
Transfer-Encoding |
chunked |
Encabezados de solicitudver fuente
Accept |
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 |
Accept-Encoding |
gzip, deflate |
Accept-Language |
es-es,es;q=0.8,en-us;q=0.5,en;q=0.3 |
Connection |
keep-alive |
Cookie |
__utma=70484738.1139431865.1346054497.1346138584.1346417597.3; __utmz=70484738.1346054497.1.1.utmcsr=esigest.com|utmccn=(referral)|utmcmd=referral|utmcct=/; PHPSESSID=oj5enn5ti4uvsts1flfbi601o7 |
Host |
www.cesilabs.com |
Referer |
https://www.cesilabs.com/esinube_desarrollo/aplicaciones/esicontactos/?desarrollo |
User-Agent |
Mozilla/5.0 (Windows NT 6.1; rv:14.0) Gecko/20100101 Firefox/14.0.1 FirePHP/0.7.1 |
x-insight |
activate |
Encabezados de respuesta de datos enviados
Content-Length |
793 |
Content-Type |
multipart/form-data; boundary=---------------------------64222494627506 |
The response in php
Code:
array(7) { ["cto_id"]=> string(1) "1" ["cto_guid"]=> string(13) "4f67784c0ae0e" ["extTID"]=> string(2) "11" ["extAction"]=> string(22) "esicontactos_contactos" ["extMethod"]=> string(17) "subirFotoContacto" ["extType"]=> string(3) "rpc" ["extUpload"]=> string(4) "true" } string(6) "<br />" NULL string(6) "<br />" array(0) { } string(6) "<br />" array(0) { } string(6) "<br />" <html><body><textarea>{"type":"rpc","tid":"11","action":"esicontactos_contactos","method":"subirFotoContacto","result":{"success":true}}</textarea></body></html>
Please help, i'm going crazy. :-((