cancel
Showing results for 
Search instead for 
Did you mean: 

Can't add files if it contain ~, &, %, and +

toni
Champ in-the-making
Champ in-the-making
Can't add files if the filename contains any of these charater ~, &, %, and +.  These are supported in Windows.

Will these be characters be supported or is there a workaround for these.

Using 1.4 Community Network, Tomcat, Windows XP
2 REPLIES 2

kevinr
Star Contributor
Star Contributor
By default the filename is restricted to characters that can be supporting in Windows, Unix, CIFS and WebDav. If this is too restrictive, then you can change the model which uses a constraint to enforce this restriction.

Look in contentModel.xml:

   <constraints>
      <constraint name="cm:filename" type="REGEX">
         <parameter name="expression"><value><![CDATA[.*[\"\*\\\>\<\?\/\:\|\xA3\xAC\%\&\+\;]+.*]]></value></parameter>
         <parameter name="requiresMatch"><value>false</value></parameter>
      </constraint>
   </constraints>

Thanks,

Kevin

tara_b
Champ in-the-making
Champ in-the-making
Hey everyone,

I am trying to overwrite the default cm:filename constraint in the default contentModel.
I've modified the file and removed the <constraint> tags completely so my cm:name property looks like this:

       
 <property name="cm:name">
               <title>Name</title>
               <type>d:text</type>
               <mandatory enforced="true">true</mandatory>
            <index enabled="true">
              <atomic>true</atomic>
              <stored>false</stored>
                  <tokenised>both</tokenised>
               </index>
            </property>

I've also modified the validation.js file to not validate at all - just return true. Still i cant upload files with characters such as < > * ?

Can anyone help?