Page 1 of 1

uploading files

PostPosted: Wed Aug 17, 2011 5:12 am
by Jean
Hi Steve and all,

I am turning around my file upload field, I could not get any result. My app is under xampp/windows system (PHP: 5.3.1; MySQL: 5.1.41).

Code: Select all
[pressbook]
widget:type= file
Type = container


The field pressbook in the database (varchar 255) remains desperatly empty like the homonymous folder in the tables/proposition_artistique parent folder.
So I tested with an other program to see if the folder was OK, it was.

I checked up the phpInfo (file_uploads On).

So far, I have no error message. I am puzzled.

Thank you for any help

Jean

Re: uploading files

PostPosted: Wed Aug 17, 2011 7:12 am
by shannah
Do you have a "pressbook" folder to receive the uploads?

Re: uploading files

PostPosted: Wed Aug 17, 2011 7:13 am
by Jean
Yes I do with the right permissions.

Re: uploading files

PostPosted: Wed Aug 17, 2011 11:41 am
by shannah
Does the error log say anything? Is the file large? (i.e. check the max post size and max upload size settings of apache and php).

Re: uploading files

PostPosted: Thu Aug 18, 2011 12:56 am
by Jean
No the log does not say anything. I tried many files and they are in the size range of the phpinfo settings.

I though about a path problem in Windows. Could it be ?

In the index.php, I have :

Code: Select all
require_once "C:\\xampp\\htdocs\\xataface-1.3rc6/dataface-public-api.php";


Could it be a problem with the mix between slashes and anti-slashes in the default path ?

Jean

Re: uploading files

PostPosted: Thu Aug 18, 2011 10:25 am
by shannah
I suppose that windows path problems is a possibility (I don't have a windows machine readily available for testing) but I would have thought I'd see other complaints from windows users if this was the case.

It is very fishy that there is no error. Generally if I have a configuration problem with respect to file uploads (e.g. folder not writable or folder doesn't exist) the application dies in spectacular fashion. A silent fail makes it sound more like it is completely unaware that you tried to upload a file. Is this version 1.3rc6?

Perhaps you could do some digging/debugging to try to hunt down the problem. The code that handles file uploads is in the Dataface/FormTool/file.php file in the pushValue() method.

-Steve

Re: uploading files

PostPosted: Fri Aug 19, 2011 5:08 am
by Jean
Thank you Steve,

I did not get anything with file.php and realized that the file fields are not in the $_POST variables sent to the index.php, as if they did not exist -- although they had been informed. This is strange. Even the empty fields have an empty variable...
:?

Re: uploading files

PostPosted: Fri Aug 19, 2011 7:53 am
by shannah
File uploads are generally provided in the $_FILES superglobal.

Re: uploading files

PostPosted: Fri Aug 19, 2011 8:18 am
by Jean
yes :oops: I need some rest...
Thank you Steve

Re: uploading files

PostPosted: Tue Aug 23, 2011 12:26 am
by Jean
Well in fact, all slashes are gone in the tmp_name index of $_FILES :
Code: Select all
[tmp_name] => C:xampptmpphpDB1.tmp

How can I prevent this ?

Jean

Re: uploading files

PostPosted: Tue Aug 23, 2011 10:28 am
by shannah
Ah.. this was happening in another thread also. I believe that it is having problems with magic quotes gpc - and stripping slashes twice. Can you check to see if you have magic_quotes_gpc turned on?

Re: uploading files

PostPosted: Wed Aug 24, 2011 1:09 am
by Jean
Thank you Steve, I set magic quotes gpc off and now it works smoothly.

Jean