Re: plus sign giving me problems in convertchars

This WebDNA talk-list message is from

2005


It keeps the original formatting.
numero = 60893
interpreted = N
texte = 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/ > > > -- > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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)
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/ > > > -- > > ------------------------------------------------------------- > 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/ > ------------------------------------------------------------- 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/ Alain Russell

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:

wc 2 pro users - sites, quotes wanted (1997) Sku numbers (1997) Re:HELP - NONE STOP DIGESTS. Digest for 4/24/97) (1997) Version f1 status (1997) A Global Variable (1997) If search results are blank... (2003) can WC render sites out? (1997) textarea to page display (1998) WebCatalog2 Feature Feedback (1996) error No such file (2001) [WebDNA] Http or Https (2009) [Summary] re: Emailer setup (1997) # fields limited? (1997) GuestBook example (1997) Searching multiple Databases (1997) Emailer prefs in two places ... (1997) tiny Linux issue (1999) WebCatalog 2.0 b 15 mac (1997) Change to 5.0 per website licensing (2003) reading a email (2000)