Bug 272996 - input type file returning 135 byte blobs
Summary: input type file returning 135 byte blobs
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: Safari 17
Hardware: Unspecified iOS 17
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2024-04-19 10:19 PDT by Erik Hoffmann
Modified: 2024-05-17 05:01 PDT (History)
6 users (show)

See Also:


Attachments
Shows the console output from the script in the issues (109.70 KB, image/png)
2024-05-17 05:01 PDT, Erik Hoffmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erik Hoffmann 2024-04-19 10:19:52 PDT
We have users on 17.4.1 getting 135 byte file data when selecting mulitple on the device.   Does not seem to matter what 'size' (small/medium/actual) the user selects to upload.

This seems simliar to this (closed) item: ttps://bugs.webkit.org/show_bug.cgi?id=256711 

Example HTML file that the users select 400+ photos; some or all the photos send up with size = 135 bytes

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title></title>
	<script src="https://code.jquery.com/jquery-3.7.1.min.js"></script>
	<script>
		$(function() {
			$("#files").on("change", function(e) {
				console.log(e);
				var results = '';
				Array.from(e.target.files).forEach((cur) => {
					let details = cur.name + ' size: ' + cur.size + ' type: ' + cur.type;
					
					console.log(details)
					if(cur.size < 1000)
					{
						results = results + "<span style='background-color:yellow'>" + details + "</span><br/>";
					}
					else {
						results = results + details + "<br/>";
					}
					
				});
				
				$("#output").html(results);
			});
		});
	
	</script>
</head>
<body>
	Select files:
<input id="files"
	title="Select photos to upload" multiple=""
	accept="image/jpg,image/jpeg,image/gif,image/png,image/heic,image/heif"
	type="file" name="qqfile"
>
  <div id="output"></div>
  
</body>
</html>
Comment 1 Erik Hoffmann 2024-04-19 10:30:41 PDT
NOTE:  In this case, users are selecting many files (400-800+ jpeg/heic/etc images) - some of them get valid sizes, some of them get the 135 bytes
Comment 2 Alexey Proskuryakov 2024-04-22 09:20:07 PDT
Thank you for the report! To clarify, are you saying that you can reproduce with this test? Is this definitely new in 17.4.1, and worked correctly in prior 17.4.x updates?
Comment 3 Erik Hoffmann 2024-04-22 10:10:15 PDT
Correct, our tester can use that web page (which is just a file picker), select a set of photos from his device & some or all of the photos end up with that invalid size (135 bytes).

I am NOT sure what specific version this started occuring on... our client started reporting issues a few months ago on various different iphones - I am not sure what versions they were on at the time.
Comment 4 Radar WebKit Bug Importer 2024-04-22 12:20:53 PDT
<rdar://problem/126875935>
Comment 5 Erik Hoffmann 2024-05-17 05:01:53 PDT
Created attachment 471432 [details]
Shows the console output from the script in the issues

The image shows the console output from the script in the issues.
A good number of the photos show a size of 135 bytes.

When we selected the specific photo one by one instead of part of a large group selection of photos - it actually had the correct size of the photo