PDA

View Full Version : Upload image problem - extra slash...



cathobby
June 10th, 2003, 08:06 PM
Hi again.

Say, we're having a problem uploading product images from the admin area... looks as if an extra slash is being added to the path causing it to error out. We're placing our product images into a subfolder of the images directory similar to this thread:

http://www.ldev.com/forums/showthread.php?s=&threadid=212&highlight=escape

Our img_path = "/images/products"

But the error that flashes by says something about "/home/cathobby/public_html/images/products//products"

Not sure where the extra "//products" is coming from. Thoughts?

Jenifer

Jamie
June 11th, 2003, 04:41 PM
Hi Jenifer,

Our you sure you do not have a trailing slash at the end of your $img_path variable?

"/home/cathobby/public_html/images/products//products" should be a valid URL, minus the extra slash. The cart puts product images here:

$img_path/products

If you have a trailing slash at the end of your variable, it would cause that problem.

Thanks,
Jamie

cathobby
June 11th, 2003, 06:46 PM
Okay, so if the system tacks on an additional "/products", then our image path should be this instead?

$img_path = "images/"

Jenifer

Jamie
June 11th, 2003, 08:09 PM
Not exactly. You can use any image path you like. Within that directory specified by $img_path, squirrelcart will use :

$img_path/products

So...removing the extra "products" folder is up to you. The problem is with the trailing slash in your $img_path variable.

Thanks,
Jamie

cathobby
June 11th, 2003, 11:27 PM
D'Oh! Sorry, I mistyped that. I meant to make my img_src = "/images"

Heh. Long day.

I now see that our mistake was in uploading the product information. Our image names should have been preceded by "products/". So, in the database, the Image field should have had "products/image1.jpg" instead of "image1.jpg".

Learn something new every day. lol

Jenifer

Jamie
June 12th, 2003, 04:00 PM
Makes sense! Thanks for the update.