Images not uploading and not updating database

A place to discuss and receive support for the Web Auction application.

Images not uploading and not updating database

Postby ejgonzal » Tue Aug 09, 2011 2:43 am

Hi,

Kinda need help, i finished installing the web auction software and seems to be working ok except for the image for the products.

Every time i create a product and attached an image (at least 24 kb) the product is added but the image is not uploaded to the server
and at the same time the product_image column on the database seems to be null.

I created simple file upload php file and seems to be working on that directory.

So im trying now to force the upload on the directory but still no go.

Code: Select all
[product_image]
Type=container
widget:type = file
allowed_extensions="jpg,gif,png"
savepath = /auction/tables/products/images
visibility:list = hidden
visibility:list = hidden   


Note: auction is a sub folder of webroot(brinkster)

Is it the correct path or am i missing something? and any idea which php file is handling the product image upload?

Thanks,
Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby shannah » Tue Aug 09, 2011 2:02 pm

Your savepath directive looks like it may be wrong. This should be a file system path (either relative to the application directory or absolute). Looks like you're using an absolute path but it is not likely a valid one unless you really have your site hosted at the root of your file system.

You might try just using a relative path:
savepath=tables/products/images

(and make sure that directory exists and is writable by the web server)
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Images not uploading and not updating database

Postby ejgonzal » Tue Aug 09, 2011 11:12 pm

Hi again,

still not working on the relative path.

im trying to trace the problem so went to the file.php itself (dataface/dataface/formtool)

it seems the isUploadedFile() is returning it false, maybe that's why its not uploading?

Code: Select all
       if ( $element->isUploadedFile() ){

        print_r($element);
        throw new Exception('there is an error' , E_USER_ERROR);         
      exit;   


it does not throw an error and saves the product successfully..any ideas please?

thanks,

edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby shannah » Wed Aug 10, 2011 9:30 am

Question: Why are you changing the savepath to begin with? The default path is tables/products/product_image . Not sure the point of changing it to another directory in the same parent folder - other than as an exercise.

Hard to comment on the problem. Could be any number of things. Would need to at least know what version of WebAuction, Web server, OS, MySQL you are running - plus any error messages in the error logs to be able to comment at all. Just double checked 0.3.6, 0.3.7, 0.3.8, and 0.3.9 on PHP 5.2 and 5.3 to confirm that upload is working for me.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Images not uploading and not updating database

Postby ejgonzal » Wed Aug 10, 2011 10:09 am

Hi Again,

Actually i returned it back to the original file since i cant troubleshoot it.

Code: Select all
[product_image]
Type=container
widget:type = file
allowed_extensions="jpg,gif,png"
visibility:list = hidden
visibility:list = hidden


I changed it since I can't make it work, the following is our basic web hosting package from brinkster.com

OS: Windows 2003 IIS 6
PHP: Version 5.2.17
Web Action : 0.3.9
MYSQL: 5.0.51

Like i said the problem is when i save the product no image is uploaded on the server and at the same time the columns (product_image and product_image_mimetype) is NULL.

Hope you have any ideas.

thanks,
Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby shannah » Wed Aug 10, 2011 10:18 am

And you've checked that the tables/products/product_image directory is writable by the web server?
You may want to check your web server for security restrictions that may prevent you from uploading files. I don't test Xataface on IIS so there is a possibility of incompatibility somewhere there (but that is probably the least likely option). However, in Apache if an apache level restriction is placed on uploads (e.g. file too large, post too large, upload disabled etc..) then PHP acts as if no file has been uploaded, and continues on its merry way. That sounds similar to what is happening with your setup. The only thing that doesn't add up is that you've already checked uploading with another PHP script and apparently it works. So it's a mystery.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Images not uploading and not updating database

Postby ejgonzal » Wed Aug 10, 2011 10:21 pm

Hi Sir Steve,

thanks for the reply, will try to check the root cause and keep you posted.

Thanks,

Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby Jean » Fri Aug 19, 2011 12:54 am

Hi Edric,
Did you find something to solve your problem ? I am interested in your solution.

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

Re: Images not uploading and not updating database

Postby ejgonzal » Fri Aug 19, 2011 3:58 am

Hi Edric,
Did you find something to solve your problem ? I am interested in your solution.

Jean


Hi Jean,

As of now, sorry but not yet making it the last problem to solve.

but i think the problem is within the PHP temp directory its not giving access to xataface. I will probably ask the host server to provide me with a custom php.ini and a temp directory.

Will keep you posted with this.

Thanks,

Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby ejgonzal » Sun Aug 21, 2011 3:24 am

Hi Steve,

I'm now checking the image problem i have.

I think the problem lies in the TEMP Name [tmp_name] => C:PHPUploadTempphp87EC.tmp

Having the special ":"

I tried running two scenarios:

Code: Select all
<?php
$temp_file = tempnam(sys_get_temp_dir(), 'tux');

echo $temp_file;
?>

The result is C:\WINDOWS\Temp\Tux87E2.tmp

The second one is the tempname generated by xataface

Code: Select all
<?php
$temp_file = tempnam(sys_get_temp_dir(), 'C:PHPUploadTempphp');

echo $temp_file;
?>


the result is C:\WINDOWS\Temp\C:P87F5.tmp

Can you point me where i can change the temp name (i.e phpupload instead of C:PHPUploadTempphp), if its possible?.I'm not yet sure if this is the cause but its worth a try. they set the temp dir in the php.ini as c:\PHPUpload but creates the temp file in c:\windows\temp

Thanks,
Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby shannah » Mon Aug 22, 2011 2:13 pm

I believe the problem is that you need to turn off magic_quotes_gpc
http://php.net/manual/en/function.get-m ... es-gpc.php

Xataface compensates when this is turned on by stripping the slashes. However in Windows the directory separators are slashes too.

There is likely something that can be done to allow Xataface to work with this, but it is generally recommended to have magic_quotes_gpc turned off anyways.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Images not uploading and not updating database

Postby ejgonzal » Mon Aug 22, 2011 10:39 pm

Added the following on the htaccess file

php_flag magic_quotes_gpc Off

and still no go.

Is there no way to change the format of the Temp Name when uploading?

Thanks,

Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

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

Can you check to verify that your php flag worked? I.e. phpinfo(); and see what it says for magic quotes gpc. Sounds like it may not be picking up your setting there.
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Images not uploading and not updating database

Postby ejgonzal » Tue Aug 23, 2011 11:22 pm

Yeah seems its not turning it off, talked to Tech Support and told me they wont turn off due to Security Reasons...

Any other options?
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Re: Images not uploading and not updating database

Postby ejgonzal » Fri Aug 26, 2011 10:36 pm

Hi Sir Steve,

Is there any work around for the magic quotes?

Running out of ideas for the image uploading

Thanks,

Edric
ejgonzal
 
Posts: 16
Joined: Tue Aug 09, 2011 2:31 am

Next

Return to Web Auction Discussion

Who is online

Users browsing this forum: No registered users and 21 guests

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