Page 1 of 1

Filter illegal characters

Posted: Wed Sep 21, 2011 4:19 pm
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'...?

Filter illegal characters

Posted: Wed Sep 21, 2011 10:55 pm
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

Filter illegal characters

Posted: Mon Sep 26, 2011 4:48 pm
by Benoit
Clive,

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

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

Benoit

Filter illegal characters

Posted: Mon Sep 26, 2011 5:31 pm
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.....