Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-1356

Problem with non-ascii characters in uploaded files filname

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • Servlets Post 2.0.4
    • None
    • Servlets

    Description

      I use a simple form to upload files into Sling, such as this one:

      <code>
      <form enctype="multipart/form-data" action="/sling/notes/*" method="POST">
      <textarea rows="5" cols="40" name="text"></textarea>

      <label>Pièce jointe:</label>
      <input type="file" name="attachments/*" class="input-text">

      <input type="hidden" value="2010-02-05T16:08:06" name="created">
      <input type="hidden" value="esg" name="creator">
      <input type="hidden" value="2010-02-05T16:08:06" name="modified">
      <input type="hidden" value="esg" name="editor">
      <input type="hidden" value="esg/notes" name="sling:resourceType">

      <input type="submit" value="envoyer" class="form-button">
      </form>
      </code>

      Everything works fine, but when the filename contains non-ascii characters the name of the node ends up wrong.
      Example:

      In the file upload input field I specify a file which name is "avé_un_assent.jpg"

      The sling node ends up being: /sling/content/notes/2_1265383081005/attachments/avé_un_assent.jpg
      where it should be /sling/content/notes/2_1265383081005/attachments/avé_un_assent.jpg (or /sling/content/notes/2_1265383081005/attachments/av%C3%A9_un_assent.jpg)

      Using esp script the Node.getName() method also return an incorrect name

      I verified content headers (sent and returned) and the content encodings are properly set to utf-8

      Thanks for your help

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            enorman Eric Norman
            cvedovini Claude Vedovini
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment