Re: plus sign giving me problems in convertchars

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 60900
interpreted = N
texte = Alain: Thanks; I will use grep. I need to start grepping more and converting chars less. Ken: Thanks for your suggestion too; I sometimes make the filename match the sku, but wanted to keep it close to the original in this case. But letting them rename it on the fly makes even better sense, especially since the advent of the digital camera. Terry >or you can just do > >[text]newfilename=[grep >search=[^0-9a-zA-Z\.]&replace=][origfilename][/grep][/text] > >This will strip all non alphanumeric characters > >A > > >On 01/02/2005, at 6:18 PM, Kenneth Grome wrote: > >> It's probably a platform-specific problem, but even if it isn't, >>plus signs do not belong in file names. >> >> If I were you, I would use the cart tag to create a new file name >>on your server ([cart].jpg) instead of using the same name for the >>file that the visitor happened to use on his computer. >> >> Then if you or your visitor don't like [cart].jpg as a file name, >>give the visitor a text field into which he should type the name he >>*wants* for the file, and use your convertchars on the text field >>value ... then replace the [cart].jpg file name with the >>convertchars-corrected value from the text field. >> >> Sincerely, >> Kenneth Grome >> www.kengrome.com >> >> P.S. You might also try using %2B instead of + in the convertchars >>database, although I really don't think this will make any >>difference ... >> >> >> >> >> >>> I have a conversion db called noillegals.db that I run filenames >>>(minus the extension) through when uploading images. It strips out >>>!, @, +, $, spaces, periods, commas, etc by converting them to >>>nothing. It works fine, except for a filename with a + in it. Is >>>there anything special about a + sign that webcat interprets >>>differently internally? Not only does it not strip the +, but when >>>it finally writes the record to the DB, it changes the + to a >>>space. So I get blahblah+blah.jpg written to disk, and blahblah >>>blah.jpg written into the DB. Even after a good night's sleep, I'm >>>stymied. >>> >>> noillegals.db >>> fromto >>> >>> . >>> + >>> = >>> # >>> etc. for the usual suspects >>> >>> [text]newfilename=[convertchars >>>db=^noillegals.db][origfilename][/convertchars][/text] >>> >>> Then later in the page, [newfilename].jpg is used in a [shell] >>>with Imagemagick to set the final file to disk, and in a [replace] >>>to populate my DB. Convertchars is only used the one time in the >>>beginning. >>> >>> Thanks, >>> Terry ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: plus sign giving me problems in convertchars ( Terry Wilson 2005)
  2. Re: plus sign giving me problems in convertchars ( Terry Wilson 2005)
  3. Re: plus sign giving me problems in convertchars ( John Peacock 2005)
  4. Re: plus sign giving me problems in convertchars ( Alain Russell 2005)
  5. Re: plus sign giving me problems in convertchars ( Kenneth Grome 2005)
  6. plus sign giving me problems in convertchars ( Terry Wilson 2005)
Alain: Thanks; I will use grep. I need to start grepping more and converting chars less. Ken: Thanks for your suggestion too; I sometimes make the filename match the sku, but wanted to keep it close to the original in this case. But letting them rename it on the fly makes even better sense, especially since the advent of the digital camera. Terry >or you can just do > >[text]newfilename=[grep >search=[^0-9a-zA-Z\.]&replace=][origfilename][/grep][/text] > >This will strip all non alphanumeric characters > >A > > >On 01/02/2005, at 6:18 PM, Kenneth Grome wrote: > >> It's probably a platform-specific problem, but even if it isn't, >>plus signs do not belong in file names. >> >> If I were you, I would use the cart tag to create a new file name >>on your server ([cart].jpg) instead of using the same name for the >>file that the visitor happened to use on his computer. >> >> Then if you or your visitor don't like [cart].jpg as a file name, >>give the visitor a text field into which he should type the name he >>*wants* for the file, and use your convertchars on the text field >>value ... then replace the [cart].jpg file name with the >>convertchars-corrected value from the text field. >> >> Sincerely, >> Kenneth Grome >> www.kengrome.com >> >> P.S. You might also try using %2B instead of + in the convertchars >>database, although I really don't think this will make any >>difference ... >> >> >> >> >> >>> I have a conversion db called noillegals.db that I run filenames >>>(minus the extension) through when uploading images. It strips out >>>!, @, +, $, spaces, periods, commas, etc by converting them to >>>nothing. It works fine, except for a filename with a + in it. Is >>>there anything special about a + sign that webcat interprets >>>differently internally? Not only does it not strip the +, but when >>>it finally writes the record to the DB, it changes the + to a >>>space. So I get blahblah+blah.jpg written to disk, and blahblah >>>blah.jpg written into the DB. Even after a good night's sleep, I'm >>>stymied. >>> >>> noillegals.db >>> fromto >>> >>> . >>> + >>> = >>> # >>> etc. for the usual suspects >>> >>> [text]newfilename=[convertchars >>>db=^noillegals.db][origfilename][/convertchars][/text] >>> >>> Then later in the page, [newfilename].jpg is used in a [shell] >>>with Imagemagick to set the final file to disk, and in a [replace] >>>to populate my DB. Convertchars is only used the one time in the >>>beginning. >>> >>> Thanks, >>> Terry ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Terry Wilson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Re:2nd WebCatalog2 Feature Request (1996) Re:Emailer and encryption (1997) possible, WebCat2.0 and checkboxes-restated (1997) Shipcost lookup? (1997) file browser. (2002) listfiles-looking for slick solution (1997) Almost a there but..bye bye NetCloak (1997) listfile options (1997) [WebDNA] [OT] Domain GolfingLadies.com (2014) WC2.0 Memory Requirements (1997) WebCatalog [FoundItems] Problem - LONG - (1997) tab deliminated txt file (2001) Banner DNA (1997) Anyone running WebMerchant 4.0? (2000) getmimeheader host on my local machine (2003) Apache 2.2 (2007) Help needed! (1998) OT: PowerKey and PageSentry not playing nice (2000) [WebDNA] High-profile WebDNA sites? (2008) Mauthcapture vs mauthonly (2002)