Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Problem Downloading products whose filename starts with #

Problem Downloading products whose filename starts with #

Views: 1,646

Results 21 to 32 of 32
3 Dec 2012, 3:28 PM
#21
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Problem Downloading products whose filename starts with #

Okay, I found the two tables you mentioned...but what do I DO with them?? LOL I see Structure, SQL, Search, Query, Export, Import, and Operations. Below that, I see Browse, Structure, Search, Insert, Empty, and Drop. I've never even seen these screens before, so I'm scared stiff of doing the wrong thing and having it all explode, backup or not.

3 Dec 2012, 3:31 PM
#22
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Re: Problem Downloading products whose filename starts with #

LOL Veeeery slowly. And thank you for your patience!!!!!

I removed the # from the filenames and, for the moment, uploaded the new copies to the server. I'll delete the original ones after all other changes are made.

There was one order that had the # in it; that's what alerted me to the problem. I sent her a copy of the file manually.

3 Dec 2012, 3:56 PM
#23
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

Okay ... now you have all of the Attributes setup still with the old filenames with the # as the first character ...

To fix this, go to your Zen Cart Admin in the Tools ... Install SQL Patches ... and run this command:

UPDATE products_attributes_download SET products_attributes_filename = replace(products_attributes_filename,substring(products_attributes_filename,1,1),'');

NOTE: I took the WHERE off of that as you want to fix all of the filenames in the database ...

Now, once you run that command, go to the Catalog ... Download Manager ... and you will see the green dot next to the filenames of the Download ... if you see a red dot, then you need to edit that Attribute and see what the filename on the server is and make sure that is what you are using for the filename on the Attribute ...

3 Dec 2012, 4:20 PM
#24
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Re: Problem Downloading products whose filename starts with #

Then I don't need to do anything in the cPanel myPHPAdmin after all?

3 Dec 2012, 4:22 PM
#25
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

That is correct ...

But you should make a backup of your database which either is done with phpMyAdmin or you can get the Plugin Add on by DrByte for backups that can be done in your Zen Cart Admin ...

3 Dec 2012, 4:24 PM
#26
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Re: Problem Downloading products whose filename starts with #

Oh, man, that really screwed things up. Not every single file name had a # in front of it, just the anthologies. Now I need to do a restore through cPanel, correct? (The backup I made was through cPanel / Files / Backup/Restore.) What should the correct code be to remove just the #? The original code you sent me?

3 Dec 2012, 4:32 PM
#27
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

Guess you will need the whole statement ...

Do the restore on your database ... check it .. then run this command:

UPDATE products_attributes_download SET products_attributes_filename = replace(products_attributes_filename,substring(products_attributes_filename,1,1),'') WHERE products_attributes_filename LIKE '#%';
3 Dec 2012, 5:20 PM
#28
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Re: Problem Downloading products whose filename starts with #

It took forever for the restore to finish...I thought it had locked up, and was getting extremely nervous!! LOL But it finally finished, so I checked that everything was back to normal, then ran your revised code.

It worked, whoo hoo!!! :D THANK YOU!!! That means I don't have to manually adjust 1400+ definitions!

Now...do I need to modify the orders-processed part? And if so, should I go back to the Tools / Install SQL Patches screen and use the second code that you originally gave me?

3 Dec 2012, 5:24 PM
#29
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

As long as you can go to the Catalog ... Download Manager ... and all filenames are green dot then you should be set ...

If, you see any with a red dot then you need to check the filename on the server and the Attribute so that they match ...

3 Dec 2012, 5:25 PM
#30
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

As to the Orders ... if you have more Orders that have the # in the filename, then yes, those too need to be updated with the SQL command for the Order Download table ...

3 Dec 2012, 5:38 PM
#31
scully avatar

scully

Zen Follower

Join Date:
Dec 2010
Posts:
257
Plugin Contributions:
0

Re: Problem Downloading products whose filename starts with #

That worked, too! :D I logged in as Tani's customer, and tried to download the pdf that had caused the problem. It worked perfectly.

THANK YOU!!!!!!!! Once again, YOU ARE THE BEST!!!!!!!!!!!!

3 Dec 2012, 5:43 PM
#32
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Problem Downloading products whose filename starts with #

Thanks for the update that all is right in the world once more ... :smile: