uploading files

A place for users and developers of the Xataface to discuss and receive support.

uploading files

Postby Jean » Wed Aug 17, 2011 5:12 am

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
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby shannah » Wed Aug 17, 2011 7:12 am

Do you have a "pressbook" folder to receive the uploads?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: uploading files

Postby Jean » Wed Aug 17, 2011 7:13 am

Yes I do with the right permissions.
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby shannah » Wed Aug 17, 2011 11:41 am

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).
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: uploading files

Postby Jean » Thu Aug 18, 2011 12:56 am

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
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby shannah » Thu Aug 18, 2011 10:25 am

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: uploading files

Postby Jean » Fri Aug 19, 2011 5:08 am

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...
:?
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby shannah » Fri Aug 19, 2011 7:53 am

File uploads are generally provided in the $_FILES superglobal.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: uploading files

Postby Jean » Fri Aug 19, 2011 8:18 am

yes :oops: I need some rest...
Thank you Steve
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby Jean » Tue Aug 23, 2011 12:26 am

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
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: uploading files

Postby shannah » Tue Aug 23, 2011 10:28 am

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?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: uploading files

Postby Jean » Wed Aug 24, 2011 1:09 am

Thank you Steve, I set magic quotes gpc off and now it works smoothly.

Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 17 guests

Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved