Filter illegal characters

Post Reply
Clive Andrews
Member
Posts: 85
Joined: Thu Jun 23, 2011 11:41 am

Filter illegal characters

Post by Clive Andrews »

Our main flow builds the archive hierarchy from the rep name/reference and the filename in the XML from iDropper.



This works fine 99.5% of the time. However, in their infinite wisdom, customers sometimes use illegal, non-dos characters in their filename.



This plays havoc with the new directory structure.



Does anyone have any thoughts on how I can build the "Archive hierarchy" but filter the 'dodgy characters'...?
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

Filter illegal characters

Post by dkelly »

Clive, couldn't you scan the filenames as String from the XML file and remove "illegal" character before creating the directories?



Dwight Kelly

Apago, Inc.

dkelly@apago.com
Benoit
Newbie
Posts: 6
Joined: Mon Jan 31, 2011 5:47 pm

Filter illegal characters

Post by Benoit »

Clive,

I rename the files before using it with a regexp like this:

replace(/[^a-zA-Z0-9_]/g,"")

Benoit
Clive Andrews
Member
Posts: 85
Joined: Thu Jun 23, 2011 11:41 am

Filter illegal characters

Post by Clive Andrews »

Benoit wrote: Clive,

I rename the files before using it with a regexp like this:

replace(/[^a-zA-Z0-9_]/g,"")

Benoit


Trouble is, I need to either catch it at the iDropper upload (where it builds the file list in XML) - or I need to edit the xml file list to match the renamed files...



Hmmm.....
Post Reply