New issue
Advanced search Search tips

Issue 784188 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner:
Closed: Nov 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Compat


Show other hotlists

Hotlists containing this issue:
Hotlist-1
Hotlist-2


Sign in to add a comment

XMLHttpRequest sending empty file when using new File() and Formdata() - iOS only

Reported by benoit.g...@gmail.com, Nov 12 2017

Issue description

Steps to reproduce the problem:
Run following code :

<script>
let file = new File(['testestestest'], "test.ext");
console.log('Client-side size : ', file.size);
fd.append("file", file);

let request = new XMLHttpRequest();
request.open("POST", "server_script.php");
request.send(fd);
request.onreadystatechange = function(e) {
    if (this.readyState === XMLHttpRequest.DONE) {
        if (this.status === 200) {
            let obj = JSON.parse(this.responseText);
            console.log('Server-side size :', obj.files.file.size);
        }
    }
}
</script>

Server script (server_script.php) :

<?php
header('Content-Type: application/json');
echo json_encode(['files' => $_FILES]);

What is the expected behavior?
Logging "Client-side size : 13", then "Server-side size : 13"

What went wrong?
Logging "Client-side size : 13", then "Server-side size : 0"
Sent file is empty.

Did this work before? N/A 

Chrome version: 62.0.3202.70  Channel: stable
OS Version: 11.1.1
Flash Version:
 
Forgot an important line at the begin of Javascript script : 

let fd = new FormData();
Components: -Blink Mobile>iOSWebView
Cc: eugene...@chromium.org
Components: Mobile>WebView>Glue
Owner: danyao@chromium.org
Status: Assigned (was: Unconfirmed)
To danyao for web compat.
Components: -Mobile>iOSWebView
Labels: -Type-Bug Type-Compat

Comment 5 by danyao@chromium.org, Nov 16 2017

Status: WontFix (was: Assigned)
This is a bug in WebKit, because I can repro in Safari (both iOS and desktop).

It appears to be fixed because I can no longer repro the bug in Safari Tech Preview 43, and in ios-simulator at WebKit head.

When Apple releases the WebKit update, Chrome will get the fix for this bug.

Sign in to add a comment