Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Images not uploading


dmcpont

Recommended Posts

Hi.. thanks everybody for your community support.

This is the first time I've had to use or depend on anyone.. don't like wasting peoples time either but this has just come up and I can't get past it.

 

Yesterday while inputing products into the os commerce site.. our site is a larger Auto Parts site called www.usgmsp.com .. for whatever reason.. the program will now not show up the listed images...

 

.. At first I thought its a bad image .. do it was deleted and replaced... no good there.. so I replaced it with an image that was already up elsewhere.. and that is no good either.

 

 

.. If I go into an existing fully functional product listing that has an image and try to change it.. we loose the image...

Not that it probably matters... but I noticed too the program was inuse pretty much 6 months to the day... and we've some 3280 products listed...

... ANYBODY got any idea's please....

thanks

Dave

:(

Link to comment
Share on other sites

  • Replies 52
  • Created
  • Last Reply

... Would that also cause the catagory images to freeze out now also... seems we can't upload a new image, but existing product images are still in place.. BUT... but.. the catagory images have going ...???

Would that same problem be directly related.. (to chmod to 755 or 777 )

(I don't have the knowledge to get into the image directory area your refering too - where do you find this... sorry probably a stupid question but I gotta ask...)???

Link to comment
Share on other sites

use your ftp program to highlight your images folder, then right click and change the properties to 777, as the documentation states it must be.

you may have access via a control panel from your host to do this too, or the ssh access.

Link to comment
Share on other sites

I am just now having a very similar problem. Had a 2.2 MS2 site up for about a year and using the "Image Resize 1.5 for MS2" mod. It's worked flawlessly in the past, but we haven't uploaded or changed products in a while. We have some products with "no photo" pics up that I now have pics for, but can't upload them. Here is what I have found:

 

Trying to upload a new pic over an existing (product), no error but the pic doesn't change. However, in the /images folder I find the pic I just tried to upload with permissions of 777 (the others have 644, while folder is 777). When I try to change the permissions on the new one, I get "550 Could not change perms on 7361_copy.jpg: Bad file descriptor" and it doesn't change.

 

The Image Resize mod uses GD Image, are you using some version of this too dmcpont? There have been no changes to the code at all since this last worked, so I am wondering about a change that might have been made in PHP versions or GD library itself. Any input is appreciated, this is a bad time to get stuck!

 

TIA

Link to comment
Share on other sites

I have noticed a similar problem in where I am adding a new product and the image isn't saving in the DB and therefor not displaying the image. It actually does upload the image, but because it isn't saving it in the db it actually is setting the attribute for null. Anyone find any information on this? It works sometimes and not others. I checked for special charectors etc, but no go. It started out slow every so often i would have to edit the db and manually add the image, but now it seems every product i have to manually enter into the db.

 

Thanks!

Link to comment
Share on other sites

Well I have confirmed that I was able to upload normally on 6/7/2004 so I think this is a recent change. Also, at some point after 11/2003 the images that have been uploaded this way are owned by "99" rather than the username of the web account. I'm still looking but I bet if some others try to upload right now they may have similar problems. I'm looking for PHP/GD Lib upgrades for the past couple of weeks, but I could be wrong.

 

Question for others with this problem: when you hit preview while uploading a new pic, does the new pic show up there? (mine doesn't) Are you using the Image Resize mod? If so, what version?

 

Report what you find!

 

Update: I have another site using Image Resize 1.3 MS2 and it seems to be working. It's hosted on the same server.

 

David

Link to comment
Share on other sites

The permissions are as I described but they don't seem to be causing the problem. Whisper is headed in the right direction I think; the image path isn't being stored in the db. I'm still thinking this might have been a change in php or mysql, because the site involved hasn't had any code changes since long before this broke. Anymore input would be appreciated. I'm going to try to debug and find out at what point this is screwing up.

 

David

Link to comment
Share on other sites

  • 3 weeks later...

Any updates on this? I am having the same problem since sometime after 6/22 where the image path is being stripped and not stored (e.g. I type in directory/image.jpg but only image.jpg is stored in the db so i have to manually change it in the products table in order for my images to display).

 

Thanks!

Link to comment
Share on other sites

My hosting provider just told me the only change they made since the last time I was able to manage images without this problem was to upgrade php from 4.3.6 to 4.3.7. Did anyone else make this upgrade right before the problem started? Or were there any other changes/upgrades on your database, server, etc.?

Link to comment
Share on other sites

It seems my host upgraded about the same time to 4.37. This is driving me crazy! I've been able to make it work albeit without really knowing why. The following is my code in categories.php under "case 'new_product_preview'":

 

case 'new_product_preview':
// copy image only if modified
       $products_image = new upload('products_image');
       $products_image->set_destination(DIR_FS_CATALOG_IMAGES);
       $products_image->set_resize(true);
       if ($products_image->parse() && $products_image->save()) {
         $products_image_name = $products_image->filename;
       } else {
// added by DR: 6-15-2004 - debug upload problem
       break;
// end
         $products_image_name = (isset($HTTP_POST_VARS['products_previous_image']) ? $HTTP_POST_VARS['products_previous_image'] : '');
       }
       break;

 

For some reason, adding the break as noted above for debugging has forced it to work. If the image is not changed (i.e. when updating other information besides the image), a warning message about "file not uploaded" displays on preview, but it doesn't seem to be a problem. I have no idea why this works which worries me. About the only thing that I can add is that during the times the upload failed before this change, the variable $products_image_name just before the last break was empty. I think the failure was because it tried to use a file name of "".

 

As I said, I do have "Image Resize 1.5 for MS2" installed and it has been working fine up to this point. Most of this stuff refers to the upload function in that mod, which is modified to include GD image resizing. If the author or anyone else has an idea of why this might have started happening with the last PHP upgrade (at least that's the theory), I would very much appreciate the input. Thanks!

 

David

Link to comment
Share on other sites

Has anyone got thois problem sorted out yet ?

"All new or updated images default back to the images directory instead of the subdirectory"

 

I am getting my hosting support to look into the PHP/ updates as was suggested above.

 

Surely this must have something to do with it as its only been happening since recent server updates.

 

Anyone got an answer yet please?

 

regards

Paul

Link to comment
Share on other sites

No update that I know of and I searched the osCommerce bugs list also. I am going to try upgrading to 4.3.7 on my laptop test environment to see if that is definitely the problem (hopefully tomorrow). Currently I do not have the problem there and the only differences are the server upgrades.

 

If I am able to upgrade my laptop and the verify that the problem is caused by 4.3.7, does anyone have any idea how we would get it fixed? This is the first time I've used the forums and I've never entered a bug report either so I'm not sure how long it will take someone to find a solution (I'm pretty new to php and have yet to find where in categories.php or classes/upload.php this is happening).

Link to comment
Share on other sites

I'm having the same problem, I'm currently developing locally. Not only does my image default to the root "images/" directory, it also makes a copy of the image from the actual path I provide and places it in the "images/" directory.

 

For example:

*I have an image with path "images/microsoft/intkeyboardps2.gif".

*I specify that I want the image path to be that above path "images/microsoft/intkeyboardps2.gif".

*The cart only stores "intkeyboardps2.gif" in the database, and makes a copy of the image with path "images/microsoft/intkeyboardps2.gif" and places it in path "images/intkeyboardps2.gif".

 

Anyone had this issue? Or found a solution?

 

Dan

( cesiumdeth )

Link to comment
Share on other sites

I contacted My Server support team and they said the following below , So be interesting to see who is to blame. Doesen't help in the mean time though. I need my site working as most others will .

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

As far as your problem goes, the tmp_upload_dir is not your problem, having it set to no value simply uses the default for php.

 

I see your problem about changing the directory in the edit part and then it not showing on the new image although this has to do with how the script is interpreting your change of the image name and has to do with osCommerce and not how PHP is working on the machine.

 

If I go to that page to upload its own image, I successfully uploaded NEW_BLACK_BOOK.jpg and it is showing within the directory structure and on the preview page.

 

As far as adding /roadshow to the end I get the same messages as you although I'm not sure how the script is working. It appears the script is not properly written as this error:

 

Warning: move_uploaded_file(/home/shopnz/public_html/shop/images/roadshow): failed to open stream: Is a directory in /home/shopnz/public_html/shop/admin/includes/classes/upload.php on line 94

 

says that php is trying to move a directory. You would have to contact osCommerce about why the /roadshow setting doesn't work.

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

Regards,

Paul

Link to comment
Share on other sites

That sounds like they were trying to set the image name to an existing directory (e.g. entering simply /roadshow in the image field) rather than an image within a directory (e.g. roadshow/NEW_BLACK_BOOK.jpg). Can you confirm that they were really entering roadshow/NEW_BLACK_BOOK.jpg in the image field (and if they weren't, ask them to try)? I don't think anyone here has mentioned getting an error like the one they sent you so I'm hoping they misunderstood and didn't enter the correct data.

 

Thanks!

Link to comment
Share on other sites

Well yes I am sure they did, I emailed complete instructions on what to do, lol but since you have asked I have emailed them for confirmation and will post back soon as I get the reply.

 

If this problem is only happening to a few of us so far, the big question is WHY...

Surely there will be an esculation of posts if its a 4.3.7 error.. lets wait and see

 

 

Cheers

Paul

Link to comment
Share on other sites

Well so far two return emails from tech support, I am also getting them make sure they tried roadshow/NEW_BLACK_BOOK.jpg correctly.

 

 

1. C:\some\directory\NEW_BLACK_BOOK.jpg/roadshow

 

and that failed out just as yours did.

 

 

 

 

2. I would have to imagine it is some sort of incompatibility with how osCommerce is written and the upgrade of PHP - which I doubt is going to be fixed with a change to PHP so you'll probably have to wait until osCommerce issues an update.

 

 

 

Cheers

Paul

Link to comment
Share on other sites

Tech support has now confirmed what happens

-----------

when you put in

roadshow/NEW_BLACK_BOOK.jpg

 

result - It still says

images/NEW_BLACK_BOOK.jpg

 

-----------

 

 

So back at square one again...Where to from here?

 

grrr this is annoying

Paul

Link to comment
Share on other sites

In my case I'm not adding any directory info at all, just uploading to images. See my description earlier in the post. I'm all but certain this has at least something to do with php 4.3.7 but am waiting for feedback from blackcat91 to know for sure.

 

David

Link to comment
Share on other sites

So just to confirm, you're just trying to replace existing images and it's not uploading them? I've just put in a request to my hosting service to roll back php to whatever it was before they upgraded. I tried getting 4.3.7 on my laptop but only managed to screw everything up :(

 

Also I have the same problem with the additional images contribution (won't store the subdirectory I enter before the image name).

 

Question: has anyone noticed any problems with incoming orders during the same time frame the image problem started? Our orders significantly dropped off (we used to get quite a few orders daily and now there are days in a row where nothing comes in) right after we were upgraded. Today I got a personal email from a friend asking me if there was something wrong with our site since her office manager created an account (on 6/25, after the upgrade) and every time she has tried to purchase something she has been kicked off the site. I'm awaiting more details from her but if this is happening to our customers it would explain the reduction in orders. I am not able to duplicate this problem and some orders are coming through but very few. If someone would be willing to try please let me know so I can give you the details. We are getting more and more concerned that this is not just an admin image problem anymore.

Link to comment
Share on other sites

I have asked Harold to look into the problem , he is going to try some stuff out my site now so hopefully he will have a definitive answer as to the problem soon.

 

I cant add new ones into a subdirectory or use a subdirectory in my images path .

it just defaults back to images.

 

As for your orders problem, mine is still receiving and processing the orders ok... fingers crossed. :)

 

Cheers

Paul

Link to comment
Share on other sites

If I go to that page to upload its own image, I successfully uploaded NEW_BLACK_BOOK.jpg and it is showing within the directory structure and on the preview page.

 

As far as adding /roadshow to the end I get the same messages as you although I'm not sure how the script is working.

I think that is where your problem is.

 

The way the product image is being handled with a stock osCommerce installation is that you are meant to upload an image on the product edit or product new page, not define an already existing image on the server.

 

All images that are uploaded via the product edit or product new page are stored in the catalog/images/ directory.

 

To define a subcategory or an already existing image on the server to the product, you will need to edit the products database table itself, specifically the products_image field.

 

ie, the SQL query might look like this:

 

update products set products_image = 'some_sub_category/some_image.jpg' where products_id = 52;

 

(be careful with SQL statements as incorrect syntax can do damage; it would be better to use phpMyAdmin)

 

It's kind of limited and will be fixed for either 2.2 MS 3 or definitely for MS 4 when contributions are implemented into the core code base.

:heart:, osCommerce

Link to comment
Share on other sites

Harold

 

your answer doesent to ring true with respect that I have always been able to add the subdirectory ie roadshow/myimage.jpg

 

Its only just very recently stopped working as is with all the oother people in this thread.

 

So are you saying that what we have benn able to do in the past was just a fluke ?

 

Do you have any idea why it might have stopped working in edit or add an new product?

 

Kind regards

Paul Fahey

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...