You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "Eric Blanquer (Jira)" <ji...@apache.org> on 2022/09/15 15:44:00 UTC

[jira] [Created] (WW-5225) add accessor to the original filename into JakartaMultiPartRequest

Eric Blanquer created WW-5225:
---------------------------------

             Summary: add accessor to the original filename into JakartaMultiPartRequest
                 Key: WW-5225
                 URL: https://issues.apache.org/jira/browse/WW-5225
             Project: Struts 2
          Issue Type: Improvement
            Reporter: Eric Blanquer


HTML input file with *webkitdirectory* *mozdirectory* allow to upload a folder

{code}<input type="file" name="folder" webkitdirectory mozdirectory />{code}

but MultiPartRequestWrapper.getFileNames("folder") returns only the canonicalName of files

https://github.com/apache/struts/blob/12beb20949a14e8bcdff2e8ca1749ea29d880a77/core/src/main/java/org/apache/struts2/dispatcher/multipart/JakartaMultiPartRequest.java#L233

it will be very useful to be able to get the original *filename* of the multipart request to be able to create the folder arborescence

multipart POST eg:
{code}-----------------------------19664509768416840202761310294
Content-Disposition: form-data; name="folder"; filename="folder0/folder1/file1.txt"
Content-Type: text/plain
-----------------------------19664509768416840202761310294
Content-Disposition: form-data; name="folder"; filename="folder0/folder2/file2.txt"
Content-Type: text/plain
-----------------------------19664509768416840202761310294
Content-Disposition: form-data; name="folder"; filename="folder0/folder3/file3.txt"
Content-Type: text/plain
-----------------------------19664509768416840202761310294--
{code}




--
This message was sent by Atlassian Jira
(v8.20.10#820010)