Tapestry
  1. Tapestry
  2. TAPESTRY-1120

UploadPart / getFileName() doesn't work cross-platform

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.2
    • Fix Version/s: 4.1.2
    • Component/s: Framework
    • Labels:
      None

      Description

      I could not reopen the issue http://issues.apache.org/bugzilla/show_bug.cgi?id=27544
      So I opened this one.

      The bug described by Karel Miarka is still not resolved. There is a bug in org.apache.tapestry.multipart.UploadPart 's getFileName method.:

      public String getFileName()
      {
      File file = new File(this.getFilePath());

      return file.getName();
      }

      You simply can not rely on JDK File implementation because it is not suitable to work cross-platform. Especially when uploading file from the MS IE client (on Windows of course to the unix-like server. MS IE sends full filename i.e. C:\Documents and Settings\user\Desktop\test.txt. This UploadPart implementation on the server use "/" character as a separator, therefore the file name could not be resolved.

      It would be appreciable if this bug would be fixed in the next release.

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Jesse Kuhnert
            Reporter:
            Martin Petras
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development