double-happiness Posted December 8, 2009 Share Posted December 8, 2009 I just started uploading images to my OSCommerce shop today and I notice that any with a ' or " in the title aren't displaying at all... Is there an easy workaround for this or do I just have to remove ' and " from all the pictures? It's a bit tricky as I have nearly 4000 images and lots of them contain these as I sell music and they are named to match the item, they are therefore quite common... Thanks Link to comment Share on other sites More sharing options...
jigga1234 Posted December 8, 2009 Share Posted December 8, 2009 I just started uploading images to my OSCommerce shop today and I notice that any with a ' or " in the title aren't displaying at all... Is there an easy workaround for this or do I just have to remove ' and " from all the pictures? It's a bit tricky as I have nearly 4000 images and lots of them contain these as I sell music and they are named to match the item, they are therefore quite common... Thanks I may be wrong but I think this might help add a / before the " or ' I think that this ignores the " or ' within an image. you dont need to rename the images but you will have to rename the image src links to accomodate the extra / if you want to ignore the " or ' in your image names. Did this help? Link to comment Share on other sites More sharing options...
double-happiness Posted December 8, 2009 Author Share Posted December 8, 2009 Hi Thanks for the reply OK this is wierd... In categories / products, I can see for example: IMAGE DOES NOT EXIST 'Weird Al' Yankovic - Eat It.jpg And when I click to edit the product it's just the same - 'Weird Al' Yankovic - Eat It.jpg but no image displaying... So I managed to find the images directory in my site and I can see \'Weird Al\' Yankovic - Eat It.jpg I don't understand what's going on... \ can't be part of a valid url can it? :'( Link to comment Share on other sites More sharing options...
spooks Posted December 8, 2009 Share Posted December 8, 2009 You should never include any quotes in a filename, you must ensure you don't use any reserved characters when saving your pictures, for best practice do not put any of: $&+,/:;=?@<>#%{}|^~[]` or any spaces or any quotes. If u have photoshop, it's save for web option will ensure a valid filename. Ps the escape character is \ Sam Remember, What you think I ment may not be what I thought I ment when I said it. Contributions: Auto Backup your Database, Easy way Multi Images with Fancy Pop-ups, Easy way Products in columns with multi buy etc etc Disable any Category or Product, Easy way Secure & Improve your account pages et al. Link to comment Share on other sites More sharing options...
jigga1234 Posted December 8, 2009 Share Posted December 8, 2009 cheers Sam I am for ever getting my / mixed up with my \ As always greatful for the pointer in the right direction :) Link to comment Share on other sites More sharing options...
npn2531 Posted December 8, 2009 Share Posted December 8, 2009 cheers Sam I am for ever getting my / mixed up with my \ As always greatful for the pointer in the right direction :) I would add to Spooks good advice above to also avoid using caps in a file name. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
double-happiness Posted December 8, 2009 Author Share Posted December 8, 2009 OK, thanks for all the advice, will need to get some batch rename freeware, no doubt I can find something to do it. :thumbsup: Link to comment Share on other sites More sharing options...
MrPhil Posted December 9, 2009 Share Posted December 9, 2009 I would add to Spooks good advice above to also avoid using caps in a file name. No need to avoid capital letters in a file name. Just be aware that all non-Windows servers are "case sensitive" in filenames -- weird_al.jpg is different from Weird_Al.JPG, so you have to be consistent in your use of capitals. Windows/IIS servers are normally case-insensitive, as well as permitting more bizarre characters in file names. Was the original problem that you wanted the image name to match the album name (or whatever), punctuation and all, or of wanting the displayed picture captions (labels) to match the album name? If the former, as has been explained, you shouldn't do it (you might want to use a Linux server some day). For the latter, I thought I heard long ago of an add-on to give images their own caption text instead of using the file name. You might look around for that. Of course that means manually adding some text for each image used... Link to comment Share on other sites More sharing options...
double-happiness Posted December 9, 2009 Author Share Posted December 9, 2009 No... The pictures wouldn't display at all... Nothing... Nada... Zip... Anything with punctuation or special characters just came up blank See for yourself if you like, if you look at all the blank ones you will see the characters ' or " in the title (the image name always matches the title except : is replaced by - ) http://www.doublehappinessrecords.co.uk/catalog/index.php?cPath=63&osCsid=492097df9058fea5ecc33720977ee7d0 Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 9, 2009 Share Posted December 9, 2009 No need to avoid capital letters in a file name. Just be aware that all non-Windows servers are "case sensitive" in filenames -- weird_al.jpg is different from Weird_Al.JPG, so you have to be consistent in your use of capitals. Windows/IIS servers are normally case-insensitive, as well as permitting more bizarre characters in file names. In Windows you can have uppercase letters in the name of the image and lowercase in the file that loads it and it will work fine. If that shop is then moved to a Linux server, the images won't load. So always using lower case will prevent possible problems. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MrPhil Posted December 9, 2009 Share Posted December 9, 2009 The pictures wouldn't display at all... Nothing... Nada... Zip... Anything with punctuation or special characters just came up blank OK, well, as you've been told, those are invalid file names on most servers. If you want to have a caption under the picture other than the actual file name, I think there may be an add-on for that. Link to comment Share on other sites More sharing options...
jigga1234 Posted December 9, 2009 Share Posted December 9, 2009 Batch File Renamer I use this. Link to comment Share on other sites More sharing options...
MrPhil Posted December 9, 2009 Share Posted December 9, 2009 In Windows you can have uppercase letters in the name of the image and lowercase in the file that loads it and it will work fine. If that shop is then moved to a Linux server, the images won't load. So always using lower case will prevent possible problems. No, that's not true. Windows is case-insensitive. It treats the file name MyPicture.JPEG the same as mypicture.jpeg, so only one file can exist with only one of those names. Linux (and most other "real" operating systems) are case-sensitive -- it treats MyPicture.JPEG as a different file than mypicture.jpeg (you can actually have both of those as different files). People used to using Windows often have a hard time getting the concept of case-sensitive file names through their heads. It's possible to use mixed case on any kind of server, but you should be careful to be consistent in your capitalization of a given file name, in case you ever move to a Linux server, where capitalization counts! Link to comment Share on other sites More sharing options...
double-happiness Posted December 9, 2009 Author Share Posted December 9, 2009 There's a caveat to that though. If you save a file mypicture.jpeg in a directory that has a file called MYPICTURE.jpeg and choose to replace the existing file, it will then be called... you guessed it... MYPICTURE.jpeg I guess this would happen because Windows replaces the existing reference in the File Allocation Table with the new cluster(s) of data, so the existing file name is preserved in it's original uppercase format though the actual data is replaced. Probably. Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 9, 2009 Share Posted December 9, 2009 No, that's not true. Windows is case-insensitive. It treats the file name MyPicture.JPEG the same as mypicture.jpeg, so only one file can exist with only one of those names. Linux (and most other "real" operating systems) are case-sensitive -- it treats MyPicture.JPEG as a different file than mypicture.jpeg (you can actually have both of those as different files). No, it's true. I think you may have misunderstood what I said r maybe I wasn't clear. Try this. Create an image named myImage.jpg and upload it to a Windows server. In the code, access the image by using myimage.jpg - it works. Now copy that image and code to a Linux server - it doesn't work. Your said their wasn't any need to pay attention to case. My point, after fixing many sites that have moved from a Windows to a Linux server, is that one should pay attention to how they name them. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MrPhil Posted December 9, 2009 Share Posted December 9, 2009 No, you're still wrong. Windows doesn't care if you name the file "myImage.jpg", and then refer to it as "myimage.jpg" -- it (wrongly) considers those two names to be identical (is case-insensitive). Linux considers those two names to be referring to two different files (is case-sensitive), and if you have a file named "myImage.jpg", it will not see it when looking for "myimage.jpg". I never said "[there] wasn't any need to pay attention to case." I said that case doesn't matter on a Windows server or PC, while it does on Linux. So, it's a good idea to capitalize a given file's name consistently, even on Windows, in case it's ever moved over to Linux. Link to comment Share on other sites More sharing options...
double-happiness Posted December 9, 2009 Author Share Posted December 9, 2009 This is getting off-topic Link to comment Share on other sites More sharing options...
npn2531 Posted December 9, 2009 Share Posted December 9, 2009 This is getting off-topic And the whole off-topic issue is mute if you consistently avoid using caps in a file name. I for one have enough code issues confounding me, and would rather not worry if MyBigEgo.gif is going to render the same as MYBIGEGO.gif or not. Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
Jack_mcs Posted December 9, 2009 Share Posted December 9, 2009 No, you're still wrong. Windows doesn't care if you name the file "myImage.jpg", and then refer to it as "myimage.jpg" -- it (wrongly) considers those two names to be identical (is case-insensitive). Linux considers those two names to be referring to two different files (is case-sensitive), and if you have a file named "myImage.jpg", it will not see it when looking for "myimage.jpg". LOL. Yes, that is my point. It will work on one and not the other because of the case. I never said "[there] wasn't any need to pay attention to case." I said that case doesn't matter on a Windows server or PC, while it does on Linux. So, it's a good idea to capitalize a given file's name consistently, even on Windows, in case it's ever moved over to Linux. You said, "No need to avoid capital letters in a file name." But there is such a need. Support Links: For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc. All of My Addons Get the latest versions of my addons Recommended SEO Addons Link to comment Share on other sites More sharing options...
MrPhil Posted December 9, 2009 Share Posted December 9, 2009 *Sigh* I'm just not getting through to you, am I? Since is has strayed far off topic, I'm going to leave it be. I just want you to understand that by not saying anything more on the subject, I'm not conceding defeat! Link to comment Share on other sites More sharing options...
double-happiness Posted December 10, 2009 Author Share Posted December 10, 2009 Absolutely ridiculuous. I've had to unsubscribe from the topic because the comments being made are nothing to do with my original problem. Thanks a bunch. Oh by the way Jack_mcs, I just had a look at your profile page, made a note of the company you work for, and determined never to use them. If they employ people like you, I don't want to know. Did you have any idea this kind of behaviour would actually lose your organisation business? This petty playground squabble does nothing for me at all, it's not helping me in the slightest. Thanks for nothing. Idiot! :angry: Link to comment Share on other sites More sharing options...
jigga1234 Posted December 10, 2009 Share Posted December 10, 2009 Sorry double, But I will take jack_mcs advice over most people on here you dont post nearly 20,000 times create and maintain one of the best contributions on OSC (IMO) and offer help for free to be given stick like you have. You asked about apostrophes and on the basis that you did not know that they caused problems jack offered his advice relating to other known issues with characters in image names incase you had trouble with these too. The posts are not just read by you but are also read by others and although not everything in the replies might be exactly what you need some people might be having similar problems and find the information given as EXTRA advice useful. Sorry for the rant but I just thought your comments were way out of order. Link to comment Share on other sites More sharing options...
Ben Nevis Posted December 10, 2009 Share Posted December 10, 2009 I'd second jigga's remarks. The irony is that I don't think Jack or Phil were really saying different things. They both acknowledge Windows is case insensitive and Linux is case sensitive. Jack was suggesting using only lowercase to avoid potential problems, Phil emphasised that there won't be problems provided capitalisation is consistent. Or something like that. Both are correct in their own terms. www.jyoshna.com. Currently using OsC with STS, Super Download Store, Categories Descriptons, Manufacturers Description, Individual Item Status, Infopages unlimited, Product Sort, Osplayer with flashmp3player, Product Tabs 2.1 with WebFx Tabpane and other bits and pieces including some I made myself. Many thanks to all whose contributions I have used! Link to comment Share on other sites More sharing options...
Guest Posted December 10, 2009 Share Posted December 10, 2009 Both are correct in their own terms. Yes, both are correct. I use a mixture of upper and lower case filenames for my images, but do not use the "same" filename (if case is disregarded). Link to comment Share on other sites More sharing options...
npn2531 Posted December 10, 2009 Share Posted December 10, 2009 Since we are already off topic and we have some experts here, I have a question about good coding procedures: I have about 10 or more lines of code, which is as you would expect in OSC, is a mix of php and html. I have three ways to type it, My question is which is faster (or does it matter): 1) as html with php tags within the line? 2) as php with the html in single quotes 3) as php with the html in single quotes, but using only one echo and and one ; command with each line on the page terminated with a coma in other words: <td>some line 1 text <?php some php ?> more text or html</td> <td>some line 2 text <?php some php ?> more text or html</td> <td>some line 3 text <?php some php ?> more text or html</td> or echo '<td>some line 1 text'.some php.'more text or html'; echo '<td>some line 2 text'.some php.'more text or html'; echo '<td>some line 3 text'.some php.'more text or html'; or echo '<td>some line 1 text'.some php.'more text or html', '<td>some line 2 text'.some php.'more text or html', '<td>some line 3 text'.some php.'more text or html'; Thanks! Oscommerce site: OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120 Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.