Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Loading 'images/' from a different server


syscon

Recommended Posts

Is it possible to load graphics from a different server?

We have a slow upload speed but another domain we have is hosted by an ISP with fast connection.

I would imagine this would speed up load time of the page, wouldn't it?

 

The pointer for 'images/' in configure. php refers to virtual/URL:

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

 

How to point/redirect to a different server?

 

Joseph

#Joseph

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

Well well well, i searched all day and finally found a way to do the images from an external site. I have 1 way to do this but i have no way of adding through admin, I use easypopulate to upload my database files and then it works, if i simply use admin, no image appears.

 

Hopefully somebody can manage to edit this????

 

I found a mod in german and added the following from it which determined if the image database field had a http:// infront of it, if it did it excluded the DIR_WS_IMAGES and fired the image from someone elses server, the only thing is you can not see it in admin either. Maybe soneone can find a way to do this.... I dunno and have not got too much time.

 

here is the code i added in html_optput.php in the catalog/includes/functions folder.

 

////
// The HTML image wrapper function
 function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
   if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
     return false;
   }

 if (substr_count ( $src, "http://")){
$src = stristr($src,"http://");
   }

 

I added the

 

  if (substr_count ( $src, "http://")){
$src = stristr($src,"http://");
   }

After the initial html image output function.

 

If works and can be seen at http://www.stuff4u2buy.com/os/

 

Anyhow, that site is slow as hell, i am having trouble putting more than 1500 products in to this system, i find that the site slows down to a page parse time of over 20 seconds if a category has more than 2000 products within it. Have a look and tell me (if you know how) how to make it faster or can anyone suggest a better cart for more products?

 

I have 400,000 products to put in there, it is gonna be huge and can osc hanndle tis?

 

Anyhow, hope u like the addon.

 

Marc

Link to comment
Share on other sites

  • 7 years later...

Up!

 

Hello,

 

I was wondering if anyone found out how to:

 

- load images from a different server

or

- save images to a different server from categories.php

 

Each time we add a new product, I need the image to be saved on the local server and a distant one. Is it possible?

If not, is it possible to save the image on the local domain and on another one which is on the same server.

 

Please... any help would be appreciated!

 

Thanks

OSC2.2

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...