jhande Posted February 16, 2009 Share Posted February 16, 2009 I have no clue when or what caused it. But all my product images uploaded through the admin panel are set to 777 permission. First I thought my host had something to do with it. So I uploaded (FTP'ed) some images to my folders and all was fine - permission 644. I then tried uploading images through Dreamweaver 8, all fine - permission 644. I just uploaded a new product to my catalog, AHH - permission 777. I did a Google search and only found this - http://www.oscommerce.com/forums/lofiversion/i...php?t43220.html Which states: Images uploaded by osCommerce are often owned by user "nobody" instead of you so you can't chmod them. The solution I found posted somewhere in these forums was to add this line chmod( $target, 0646 ); right after this line move_uploaded_file($filename['tmp_name'], $target); in admin/includes/functions/general.php. Unfortunately this only fixes the problem for future uploads. I have a pretty small store, so I just re-uploaded all my pictures. For a larger store you would want to figure out how to do it programatically. I'm not sure if this is related as I can't find such a line in my general.php file. Any ideas how I can have the default image file permissions set to 644 as they should be? I just spent the last half hour in my cPanels File Manger changing all my current image permissions. It sure will be a pain in the arse having to do that everytime I upload products/images. <_< - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 - Link to comment Share on other sites More sharing options...
germ Posted February 16, 2009 Share Posted February 16, 2009 /admin/includes/classes/upload.php function upload($file = '', $destination = '', $permissions = '777', $extensions = '') { Try changing the $permissions variabe there. If that doesn't work I don't know. :blush: If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
jhande Posted February 16, 2009 Author Share Posted February 16, 2009 Thanks Jim ;) I just made that edit and will give it a try shortly. - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 - Link to comment Share on other sites More sharing options...
jhande Posted February 16, 2009 Author Share Posted February 16, 2009 Thanks Jim ;) Just uploaded a new product and the image permission is 644. WooHoo no more changing permissions :D Thanks again Jim!!! - :: Jim :: - - My Toolbox ~ Adobe Web Bundle, XAMPP & WinMerge | Install ~ osC v2.3.3.4 - Link to comment Share on other sites More sharing options...
Guest Posted February 16, 2009 Share Posted February 16, 2009 thanks for posting this! i never noticed this until now (had a custom edit in admin/categories.php so all product images were fine) but all of my category images were uploading at 777 for years! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.