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

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

     [ https://issues.apache.org/jira/browse/WW-5225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lukasz Lenart updated WW-5225:
------------------------------
    Fix Version/s: 6.1.0

> 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
>            Priority: Trivial
>             Fix For: 6.1.0
>
>
> 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)