JDK-8337481 : File API: file.name contains path instead of name
  • Type: Bug
  • Component: javafx
  • Sub-Component: web
  • Affected Version:
    8u331,jfx17.0.3,jfx18.0.1,jfx19,jfx23 8u331,jfx17.0.3,jfx18.0.1,jfx19,jfx23
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2024-07-30
  • Updated: 2024-09-09
  • Resolved: 2024-08-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
jfx23.0.1Fixed
Related Reports
Relates :  
Description
When a file is selected in HTML file input field, the resulting File-Object contains a path with file.name instead of only the file name.

A HTML sample is attached.

Last working versions:
17.0.2
18
First failing versions:
17.0.6, 17.0.3-17.0.5 are not available in maven central.
18.0.1
Comments
A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx23u/pull/19 Date: 2024-09-04 12:30:43 +0000
04-09-2024

[jfx23u-fix-request] Approval Request from Oliver Schmidtmer
04-09-2024

[~oschmidtmer] Please proceed with the jfx23u backport. I'll approve it once the PR is rfr and you have made the backport request. You can ask [~jvos] about the backports to jfx21u and jfx17u.
04-09-2024

Backport request for jfx23u and others: This causes problems in the JavaScript File-API and HTTP part headers since the WebKit update to 613.1
04-09-2024

Changeset: ca70a07b Branch: master Author: Oliver Schmidtmer <O.Schmidtmer@elo.com> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2024-08-30 19:45:56 +0000 URL: https://git.openjdk.org/jfx/commit/ca70a07b3ee712b1d06baf8a3901e6ae96070124
30-08-2024

[~hmeda] Please sponsor this PR, once you have reviewed it.
29-08-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jfx/pull/1551 Date: 2024-08-29 13:16:11 +0000
29-08-2024

The cause are changes in 8278980: Update WebKit to 613.1: In "modules/javafx.web/src/main/native/Source/WebCore/fileapi/File.cpp" the line "effectiveName = nameOverride.isEmpty() ? FileSystem::pathGetFileName(path): nameOverride;" was changed to "effectiveName = nameOverride.isEmpty() ? FileSystem::pathFileName(path): nameOverride;" as FileSystem.h had a name change. This caused the override from FileSystemJava to not be used anymore. Later there was a compile time switch for Java added, as FileSystem::pathGetFileName(path) returns an empty string. So probably the solution is to rename pathGetFileName to pathFileName in FileSystemJava.cpp and remove the compile time switch in File.cpp
29-08-2024