<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>311436</bug_id>
          
          <creation_ts>2026-04-03 13:08:58 -0700</creation_ts>
          <short_desc>Directory path is incorrect in http/tests/security/file-system-access-via-dataTransfer.html</short_desc>
          <delta_ts>2026-04-03 18:25:57 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Anthony Tarbinian">a.tarbinian</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2196674</commentid>
    <comment_count>0</comment_count>
    <who name="Anthony Tarbinian">a.tarbinian</who>
    <bug_when>2026-04-03 13:08:58 -0700</bug_when>
    <thetext>In http/tests/security/file-system-access-via-dataTransfer.html , the targetDirectory variable doesn&apos;t have the path of a valid directory. This is what the code looks like:

```
    let path = location.pathname.split(&quot;/&quot;);
    let filename = path[path.length - 1];
    let targetFileName = internals.createTemporaryFile(`${filename}`, &quot;&quot;);
    let targetDirectory = targetFileName.substring(0, targetFileName.length - filename);
```

Note that targetDirectory is created by taking the substring of targetFileName, however the end of the substring is calculated by doing `targetFileName.length - filename` where filename is a string, not a number. This should be `filename.length` instead. However even when making that change, the targetDirectory still isn&apos;t quite right. See the following logs:

```
path: [&quot;&quot;,&quot;security&quot;,&quot;file-system-access-via-dataTransfer.html&quot;]
filename: file-system-access-via-dataTransfer.html
targetFileName: /var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-system-access-via-dataTransfer.htmlnc3lIz
targetDirectory: /var/folders/gt/fcd9q4nn66bbk9l0jq5bj6sw0000gn/T/WebKitTestRunners-w8rnouln/WebCoreTesting-file-s
```

Note how targetDirectory has some trailing characters of &quot;WebCoreTesting-file-s&quot; after the directory path. It seems like `internals.createTemporaryFile` is padding some extra characters onto the original filename.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2196675</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-04-03 13:09:04 -0700</bug_when>
    <thetext>&lt;rdar://problem/174033719&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2196679</commentid>
    <comment_count>2</comment_count>
    <who name="Anthony Tarbinian">a.tarbinian</who>
    <bug_when>2026-04-03 13:23:22 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/61992</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2196753</commentid>
    <comment_count>3</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2026-04-03 18:25:56 -0700</bug_when>
    <thetext>Committed 310549@main (6e308cecbfca): &lt;https://commits.webkit.org/310549@main&gt;

Reviewed commits have been landed. Closing PR #61992 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>