Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Images wont upload to a directory


headless_pnub

Recommended Posts

Posted

Hi everyone,

 

I'm trying to upload the images for my catagories to a specific folder on my server as done with the example projects (dvd etc...), but when i do it wont let me save. I can upload them just to the images folder, but not another folder within there. Am i doning something wrong or do i just have to have all the images in a flat file structure?

 

Any help appreciated.

 

Kath

Posted

Thanks, that's perfect for the products themselves, but I was also wondering if this was possible for the catagories images themselves.

i.e If I have a catagory call "ipods", I want a picture of a standard ipod and then within that catagory have the different products for sale (if you get what i mean).

 

Thanks again for your help so far.

Kath

Posted

I would just do that manually using a database back up. Create the directory structure you want, then when adding new categories, I would leave the image blank. Then I would make a backup from admin, download it, open it in a text editor, find the relevant query and add the path/image to it. Then upload it again into the backups directory, go into admin and restore it.

As an example, this is the query from a stock database backup, for the "Hardware" category:

 

insert into categories (categories_id, categories_image, parent_id, sort_order, date_added, last_modified) values ('1', 'category_hardware.gif', '0', '1', '2007-04-07 02:28:05', NULL);

 

If I wanted to put the catagory image into its own unique directory, that I had already created on the server, I would change it so:

 

insert into categories (categories_id, categories_image, parent_id, sort_order, date_added, last_modified) values ('1', 'hardware/logos/category_hardware.gif', '0', '1', '2007-04-07 02:28:05', NULL);

 

If you leave the image field blank when you create the category in admin, then you would add the image as well as the directory path. The blank image query would look like this:

 

insert into categories (categories_id, categories_image, parent_id, sort_order, date_added, last_modified) values ('1', '', '0', '1', '2007-04-07 02:28:05', NULL);

 

There are other ways to do it, phpmyadmin, Easy Populate, there's probably a contribution to do just that (I don't know it). It probably wouldn't be too difficult to adapt that contribution I gave you...........something to have a look at later!

 

Anyhoo, I hope this hasn't confused you too much.

 

EDIT: Forgot to say, you would obviously need to upload your image to whatever directory you named in the query. :rolleyes:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...