PDA

View Full Version : Ext.ux.UploadDialog not post the filename



ocheneson
28 Dec 2007, 5:23 AM
Hello,

I am using the uploaddialog from Maxim Bazhenov


this.dlg = new Ext.ux.UploadDialog.Dialog(null, {
autoCreate: true,
closable: false,
collapsible: false,
draggable: true,
minWidth: 400,
minHeight: 200,
modal:true,
width: 400,
height: 350,
proxyDrag: true,
resizable: false,
constraintoviewport: true,
title: 'Upload',
url: 'upload.php?reqaction=uploadfile&resptype=json',
reset_on_hide: false,
allow_close_on_upload: true,
upload_autostart: false,
permitted_extensions: ["txt"]
});




<?php

$uploaddir = 'files/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);

$response = array();
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
$response['success'] = true;
$response['message'] = 'File uploaded successfully';
}
else {
$response['success'] = false;
$response['message'] = 'Some error occurred during file upload';
}
echo json_encode($response);
?>


I can show the upload dialog , browse to a file. But when i tried to access the $_FILES['file'], it gives me an error. I can see it in Firebug

Can you check my code ?

Do you have some examples ?


thanks
Olivier

MaximGB
28 Dec 2007, 9:02 AM
What error do you see in the Firebug exactly?

ocheneson
30 Dec 2007, 8:54 AM
I can see in firebug that the uploaddialog is doing the request but no data in POST

When i try to access $_FILES in php the array is empty.

In firebug, i see that my php code is returning an error that the $_FILEs is not defined.

THanks
Olivier

MaximGB
30 Dec 2007, 10:46 AM
PHP Version?
OS Version?
Do you have file_uploads = On in php.ini?
Do you have upload_tmp_dir set in php.ini?
What permissions are set on upload directory?

Also try to use base_params config option for sending query parameters like "reqaction=uploadfile&resptype=json"

ocheneson
2 Jan 2008, 3:11 AM
I am using PHP 5.2.0

The tmp dir is ok, i have a simple upload in HTML and it works

using the base_params doesnt pass the parameters.

ocheneson
2 Jan 2008, 3:12 AM
Can you copy a simple syntax how to pass the params via base_params ?


thanks
Olivier

MaximGB
2 Jan 2008, 4:23 AM
dialog = new Ext.ux.UploadDialog.Dialog(null, {
autoCreate: true,
closable: true,
collapsible: false,
draggable: true,
minWidth: 400,
minHeight: 200,
width: 400,
height: 350,
proxyDrag: true,
resizable: true,
constraintoviewport: true,
title: 'File upload queue.',
url: 'upload-dialog-request.php',
reset_on_hide: false,
allow_close_on_upload: true,
upload_autostart: true,
base_params: { reqaction: 'uploadfile', resptype: 'json' }
});
Also you can set base_params with setBaseParams() method.

ocheneson
2 Jan 2008, 8:04 AM
I added the code but i still cannot see the params

Can you send me again the URL with the latest code ?

Just to make sure.

thanks
Olivier

MaximGB
2 Jan 2008, 8:44 AM
For ExtJS 1.x
http://max-bazhenov.com/dev/upload-dialog-1.0/ExtJS.ux/Ext.ux.UploadDialog.zip

For ExtJS 2.x
http://max-bazhenov.com/dev/upload-dialog-2.0/ExtJS.ux/Ext.ux.UploadDialog.zip

Can you give me a link to a page where you use the extension and ftp access? Then I can check both server side and client side code and point you where the error is..

ocheneson
2 Jan 2008, 11:55 PM
Maxim,

Now it is working. I was not returning the correct JSON string.

Now it is ok and i can access $_FILES

THanks for your help

Olivier

ftplove
6 Jan 2008, 1:58 AM
Hello,

I am using the uploaddialog from Maxim Bazhenov


this.dlg = new Ext.ux.UploadDialog.Dialog(null, {
autoCreate: true,
closable: false,
collapsible: false,
draggable: true,
minWidth: 400,
minHeight: 200,
modal:true,
width: 400,
height: 350,
proxyDrag: true,
resizable: false,
constraintoviewport: true,
title: 'Upload',
url: 'upload.php?reqaction=uploadfile&resptype=json',
reset_on_hide: false,
allow_close_on_upload: true,
upload_autostart: false,
permitted_extensions: ["txt"]
});




<?php

$uploaddir = 'files/';
$uploadfile = $uploaddir . basename($_FILES['file']['name']);

$response = array();
if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile)) {
$response['success'] = true;
$response['message'] = 'File uploaded successfully';
}
else {
$response['success'] = false;
$response['message'] = 'Some error occurred during file upload';
}
echo json_encode($response);
?>


I can show the upload dialog , browse to a file. But when i tried to access the $_FILES['file'], it gives me an error. I can see it in Firebug

Can you check my code ?

Do you have some examples ?
3635

thanks
Olivier

thx

kaki
19 Mar 2008, 4:03 AM
Do you have some examples ?\:D/

userofit
15 Apr 2008, 8:39 AM
I am still using Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.13) Gecko/20060414, and I found the background of the file name and note columns appear abnormal, and there is no file name shown under file name column. Can you fix it? Or is it worthy of fixing it?

Any ways, it is really a good job. I enjoy it\:D/.

Thanks.

pcrombach
10 Jul 2008, 11:39 AM
Hallo, I understand what should happen if you start an upload. Hidden form etcetc. In my backend PHP file I cant retrieve the $_FILES param. If I make a simple HTML page with an INPUT TYPE=file field calling the same backind PHP all work perfect.

Maybe somebody can help me......

Thanks

franklt69
23 Jul 2008, 6:04 AM
Hi, is there some limitation about the size of file to upload?

I am testing it with file approx 2 Mb and work ok, now I am testing with a file of 24Mbyte and don't work, any info is welcome.

regards
Frank

loke
22 Jun 2009, 1:29 AM
i don seem to returning the correct JSON string too.. how/what did u do to ur php to make it work?

dcbal
28 Oct 2009, 1:05 AM
I have problem....
I instaled extjs 3.0 and UploadDialog, after run error Ext.ux.UploadDialog is undefined.
File Ext.ux.UploadDialog.js included.
HELP