Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change the image upload directory


bkng

Recommended Posts

Wel ok that changes the directory for all the images. What i need is a seperate upload directory for the images that are uploaded throug the admin program. I want those images in a seperate directory away from the standard items wich are used by OSC.

 

You see?????????????????

Link to comment
Share on other sites

Wel ok that changes the directory for all the images. What i need is a seperate upload directory for the images that are uploaded throug the admin program. I want those images in a seperate directory away from the standard items wich are used by OSC.

 

This isn't currently available in CVS at the moment.

 

They only way you could do it was by running an SQL query using PhpMyAdmin to add the extra directory name it.

Mark Evans

osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops)

 

---------------------------------------

Software is like sex: It's better when it's free. (Linus Torvalds)

Link to comment
Share on other sites

Or (AT YOUR OWN RISK!):

 

1) Install the Quick Updates pack from Downloads

2) Add or modify one column to deal with images. I can't explain this in detail but if you study the main file in this pack (it is quite logicallyset-out) and then replace or add the code for one column with:

 

if ($action == "update") {

foreach($HTTP_POST_VARS['products_new_image'] as $id => $new_image) {

mysql_query("UPDATE products SET products_image='$new_image' WHERE products_id=$id");

}

 

and:

 

<td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_IMAGE; ?></td>

 

and:

 

echo "<td class="smallText" valign="top" align="center"><input type="text" size="25" name="products_new_image[".$row['products_id']."]" value={$row['products_image']}></td>n";

 

and:

 

add a definition for TABLE_HEADING_IMAGE to the quick updates language file.

 

To use, just:

 

1) Manually create the image sub-directories and upload images files as required using your ftp program.

 

2) You can then just type in the image path as text e.g. 'mysubdirectory/myimage.jpg' using the Quick Updates add-on.

 

Sounds complex but once you have done it, it is reasonably simple as you can just paste in image names. One limitation is that this method does not allow image names with spaces in them - so replace all spaces with underscore and no problems.

 

I am not sure if the images get deleted again with the product but this is not much of a problem as you can just manually clean up later.

Ian-san

Flawlessnet

Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

ok,

 

heres my problem,

 

i have to shops running on one server.

both shops will sell the same products, so i want only one image category.

like mentioned above i tried to change the directory in include-configure.php.

 

but it is not working, for shure i made a little mistake :blush:

here is what i have moded.

 

define('DIR_WS_IMAGES', '/home/xyz/public_html/catalog/images/');

 

the shop is running in the folder catalog2.

 

also i changed the directorys in admin-includes-configure.php

 

define('DIR_WS_IMAGES', '/home/xyz/public_html/catalog/images/');

and

define('DIR_WS_CATALOG_IMAGES', DIR_WS_CATALOG . '/home/xyz/public_html/catalog/images/');

 

 

any idea whats wrong here ?

Link to comment
Share on other sites

If the site is running in the folder catalog2, then this is what it should read:

define('DIR_WS_IMAGES', 'images/');

 

The path to catalog is defined in another part of the configure.php file, as:

/catalog2/

 

Vger

Link to comment
Share on other sites

ok, ok found it.

 

// Define the webserver and path parameters

// * DIR_FS_* = Filesystem directories (local/physical)

// * DIR_WS_* = Webserver directories (virtual/URL)

 

so it should look like this

define('DIR_WS_IMAGES', 'http://xyz.com/catalog/images/');

 

no its running just fine, thanks

 

chris

Link to comment
Share on other sites

but, heres antoher problem.

no iam unable to set the permissions of include-configure.php. to read only. somehow i save the new setting with the ftp client, but after checking it afterwards the permission is read and write again.

 

strange

Link to comment
Share on other sites

No, doing it that way you have just hard-coded the path to the images directory via your domain name. That will cause problems for you later on. dir_ws_images just needs to be images/ (nothing else). If that does not work then it's because you have errors elsewhere in your configure.php file.

 

Vger

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...