Zen Cart Logo
Forums / General Questions / uploading artwork file (attribute) does not upload file

uploading artwork file (attribute) does not upload file

Views: 1,993

Results 1 to 12 of 12
7 Aug 2013, 1:36 PM
#1
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

uploading artwork file (attribute) does not upload file

Out of all my years working in zen cart I've never been required to set up a file upload. I know this works and I thought I knew what to do but the truth is that it's not working.

Attribute is set up as a file. After you browse for the image and select one (I am using a very small one), the name of the image appears. When you add to cart, there is no evidence that the file uploaded and sure enough, it hasn't uploaded.

What file controls the uploading of the attribute images? I know that I have the correct version of the modules/attribute.php file in the cart.

The images folder is set at 755 on this server and there's no problem uploading product images. I even checked the configure file to make sure all was fine there.

No dice. It's just not uploading files and I don't know why or where this is in the zen cart file structure to check. Help point the way for me.

7 Aug 2013, 2:41 PM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: uploading artwork file (attribute) does not upload file

I just set up a product with a file upload on a test site. When I checked out, the file name was listed in the shopping cart, but the file is nowhere to be found on the server. Not sure if this is a bug or I did something wrong.

7 Aug 2013, 2:53 PM
#3
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: uploading artwork file (attribute) does not upload file

Oops. Never mind. I was expecting the file to be uploaded with its original file name. It is in the images/upload folder with the file name 1.jpg. I guess the next file uploaded will be 2.jpg, etc.

7 Aug 2013, 2:56 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: uploading artwork file (attribute) does not upload file

I just set up a fresh 1.5.1 site to test it. I used the "Bug's Life Multi-Pak" product from the demo products, and simply chose a basic 1K .jpg file from my local computer as the item I wanted to upload.
The server I used for this requires 777 for uploading, so I tested it first with 755, and it gave me a nice MessageStack error message on the Shopping Cart page (since it redirects to the shopping cart during add-to-cart), saying "Error: Destination not writable".
When I changed it to 777 and tried again it gave me a new alert saying File uploaded successfully, and I can see the filename in the attribute details of the product added to the cart.

My server's PHP is configured to allow file-uploads, upload-max-size is set to 2M, and post-max-size is set to 8M, and the upload-tmp-folder is the default /tmp folder which has normal system permissions. These are all the same kind of settings that allow the admin side to upload product images as well.

In fact the same upload code is used for both catalog and admin.

7 Aug 2013, 3:37 PM
#5
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: uploading artwork file (attribute) does not upload file

an alert saying it was successful? Not seeing any messaging at all. We are about to install a new template though - no messaging might be caused by the old, crappy template. Just missing that alert message tells me something is wrong. So will revisit this if necessary once the new template.

Thanks Dr. Byte!

7 Aug 2013, 3:39 PM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: uploading artwork file (attribute) does not upload file

I did my testing using Classic, based on the original v1.5.1 install.

23 Aug 2013, 9:21 PM
#7
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: uploading artwork file (attribute) does not upload file

So I accidentally found the result of the problem in the page source:

<h4 class="optionName back"><label class="attribsUploads" for="attrib-44-0">Art File Upload</label></h4> <div class="back"> <input type="file" name="id[TEXT_PREFIX44]" id="attrib-44-0" /><br /> <input type="hidden" name="UPLOAD_PREFIX1" value="44" /> <input type="hidden" name="TEXT_PREFIXUPLOAD_PREFIX1" />

The other attributes aren't having this problem, only the upload one is. I made sure the files that mention either the TEXT_PREFIX or the UPLOAD_PREFIX are fresh files with no overrides. But it's not creating the proper substitutions.

Any guesses?

30 Aug 2013, 6:02 PM
#8
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: uploading artwork file (attribute) does not upload file

Those missing parameters are in the configuration settings and missing in the database. So of course then I don't know what else is missing but at least the source code now shows the correct stuff.

Still doesn't work.

The site was a fresh install of 1.3.7, upgraded to 1.3.8 and then to 1.3.9h.

The missing config settings were added / modified back long before 1.3.7 so looks like they may have gotten eliminated somehow.

But I'm left with the question of what else might be missing. I checked the config settings in the sql around these parameters and everything seems to be there. So the question is do I still have a database problem or not.

Is there any facility that allow checking existing configuration settings against what is supposed to be there? Another upgrade would not seem to the answer. Starting with a new cart and recreating the site looks to be the only way to solve this but I sure want to have explored all the options before then. Client does not want to go that extra money to upgrade or recreate the site right now.

1 Sep 2013, 3:43 AM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: uploading artwork file (attribute) does not upload file

I'd probably compare all the configuration_key entries from the configuration table in that database with those from a good database, and see what's missing. Then work on a plan to put back the ones that shouldn't have been deleted in the first place.

1 Sep 2013, 2:03 PM
#10
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: uploading artwork file (attribute) does not upload file

Done and found one extra setting missing - nothing to do with this. That was easier than I had thought actually.

I have checked / uploaded again fresh all files that I can find that have anything to do with uploading images:
classes/upload.php
functions/compatibility.php
modules/attributes.php
templates - tpl_main_page.php
tpl_modules_attributes.php

No problem adding images in admin.
Image folders named correctly and working fine.

checked config files for proper designation of upload directory

Unless you can think of anything I might have missed, I'm going to have to recommend she start over again.

1 Sep 2013, 4:36 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: uploading artwork file (attribute) does not upload file

In odd situations like this, especially when suggesting "starting over", I'd first set up a fresh ZC site in another folder+database and test that functionality. Rule out the hosting environment. Then compare folder permissions, PHP files, etc, to find out the culprit, before wiping everything out.

1 Sep 2013, 7:41 PM
#12
delia avatar

delia

Totally Zenned

Join Date:
May 2006
Location:
Gardiner, Maine
Posts:
2,383
Plugin Contributions:
7

Re: uploading artwork file (attribute) does not upload file

Yup, exactly my thought. So uploaded fresh version of zen art into another folder with old database. Works.

Then I started using my head. The only mod really in this cart? Simple SEO URL's. Main file affected? functions/html_output.php

I uploaded the version from the mod that I knew was the most recent and bingo, problem solved. The mod wasn't completely upgraded in the past.

Thanks for your feedback and advice. My client is going to be thrilled!