Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

upload image path problems


roomboom

Recommended Posts

This is the weirdest problem I have ever come across, honestly, read on...

 

About 5 days ago, a client called us and said that all the products had disappeared out of their shop. I thought it was yet another problem with the hosting company, but looking at the site I discovered it wasn't....

 

All the product info had gone, the images, but nothing else. It looked as though someone had gone into the admin kit and deleted all the main categories, thus killing off all the products (not that weird so far).

 

So I changed the passwords, and restored the site from a backup. However, there was some data and images missing, so I told the client to go back through the stock and re-upload the missing images....

 

They called me back and said this was no longer working, I tried it and it worked fine. However, they were using IE, and I was using Firefox. No when I tried IE - same thing as them...

 

The image name it gave when uploading the file contains the ENTIRE local path to the image, so for example, if my image was stored locally as..

 

C:\images\upload\product005.jpg

 

it should upload and store as product005.jpg, but it uploads as...

 

c:imagesuploadproduct005

 

and yet in firefox this works fine, and it was working fine in IE until all the images went missing. I have the auto-resize hack installed, but can't think it's anything to do with that!

 

Anyone has any ideas on how this would have happened PLEASE let me know....

 

It's messing with my melon, man.

Jon

Link to comment
Share on other sites

We have exactly the same problem. Reason for ours is that our hosts (Fasthosts) have upgraded to php 4.3.11-dev which unfortunately includes a change which means that Internet Explorer will now pass the whole of the upload string to the script. The PHP software foundation are apparently aware of this but have not released a fix for it at this time. Until then it's recommended that we alter the script to parse out the final part of the string in order to retrieve the filename.

 

If anyone can suggest the best way to do that it would be handy!

Link to comment
Share on other sites

Question, are you using the Admin Add Product Upload to upload your images? If so, try using FTP to put your images into the Images folder and see it that works.

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

No responsible hosting company would install a development version of any scripting technology on their customers servers. But - we are talking about Fasthosts so that doesn't apply.

 

You will find that any responsible hosting company, in response to a threat or vulnerability will upgrade their software/control panels etc. However, the only known vulnerabilities in recent times with regard to php were patched by upgrading to 4.3.10 or 5+ There's absolutely no need to upgrade to an unproven and buggy development version.

 

Vger

Link to comment
Share on other sites

They say they did the update 'On Friday', which would have to be last Friday (4th). But phpinfo shows: Build Date Feb 8 2005 11:01:49 - which was Tuesday. Search me!

 

Their support staff are reasonable enough if you can get through to them. Working in Babylon for Mamon ... taking their pieces of silver and rendering unto Caeser etc. etc. etc.

 

A telephone call at 3.30 in the morning usually does the trick!

 

I've wasted two solid days working this problem until they finally admitted it was their fault not mine. They ain't making life easy for the rest of us. That's the truth. :'(

Link to comment
Share on other sites

They say they did the update 'On Friday', which would have to be last Friday (4th). But phpinfo shows: Build Date Feb 8 2005 11:01:49 - which was Tuesday. Search me!

 

Their support staff are reasonable enough if you can get through to them. Working in Babylon for Mamon ... taking their pieces of silver and rendering unto Caeser etc. etc. etc.

 

A telephone call at 3.30 in the morning usually does the trick!

 

I've wasted two solid days working this problem until they finally admitted it was their fault not mine. They ain't making life easy for the rest of us. That's the truth. :'(

 

yup, they're sh*t alright.

Jon

Link to comment
Share on other sites

OK. But what we need is to either change hosts or do a workaround.

 

Fasthosts sent me their suggestion for a fix:

 

<?php

 

if(!isset($_FILES['userfile']))

{

?>

 

<form enctype="multipart/form-data" action="" method="POST">

<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />

Send this file: <input name="userfile" type="file" />

<input type="submit" value="Send File" />

</form>

 

<?

exit(0);

}

 

echo '<pre>';

$filename = $_FILES['userfile']['name'];

$newfilename = substr(strrchr($_FILES['userfile']['name'],"\\"),1);

echo "New PHP hands us $filename as the filename<BR>";

echo "We need to parse this down to $newfilename using strrchr()<BR>";

echo "E.G \$newfile = substr(strrchr(\$_FILES['userfile']['name'],\"\\\"),1);<BR>";

 

?>

 

I reckon it will take me a couple of hours to get my head around that, integrate it into the osCommerce scipt, test it to destruction etc.

 

If there's anybody out there who is up to speed enough to provide a quick solution and let us know exactly what changes to make it would be greatly appreciated. :rolleyes:

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...