title: CFSCRIPT - How to check the length of a filename before uploading
body: <p>I ran into this problem when uploading a file with a super long name - my database field was only set to 50 characters.  Since then, I have increased my database field length, but I'd like to have a way to check the length of the filename before uploading.  Below is my code.  The validation returns '85' as the character length.  And it returns the same count for every different file I upload (none of which have a file name length of 85).</p>
  
  <pre><code>    &lt;cfscript&gt;
      missing_info = "&lt;p&gt;There was a slight problem with your submission. The following are required or invalid:&lt;/p&gt;&lt;ul&gt;";
      // Check the length of the file name for our database field
      if ( len(Form["ResumeFile1"]) gt 100 )
      {
      missing_info = missing_info &amp; "&lt;li&gt;'Resume File 1' is invalid. Character length must be less than 100. Current count is " &amp; len(Form["ResumeFile1"]) &amp; ".&lt;/li&gt;";
      validation_error = true;
      ResumeFileInvalidMarker  = true;
      }
      &lt;/cfscript&gt;
  </code></pre>
  
  <p>Anyone see anything wrong with this?</p>
  
  <p>Thanks!</p>