11cb0ef41Sopenharmony_ci<!DOCTYPE html>
21cb0ef41Sopenharmony_ci<meta charset="utf-8" />
31cb0ef41Sopenharmony_ci<title>FormData: Upload files named using controls (tentative)</title>
41cb0ef41Sopenharmony_ci<!--
51cb0ef41Sopenharmony_ci    NOTE: This test is tentative because encoding for filename
61cb0ef41Sopenharmony_ci    control characters is not yet standardized.
71cb0ef41Sopenharmony_ci  -->
81cb0ef41Sopenharmony_ci<link
91cb0ef41Sopenharmony_ci  rel="help"
101cb0ef41Sopenharmony_ci  href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data"
111cb0ef41Sopenharmony_ci/>
121cb0ef41Sopenharmony_ci<link
131cb0ef41Sopenharmony_ci  rel="help"
141cb0ef41Sopenharmony_ci  href="https://html.spec.whatwg.org/multipage/dnd.html#datatransferitemlist"
151cb0ef41Sopenharmony_ci/>
161cb0ef41Sopenharmony_ci<link rel="help" href="https://w3c.github.io/FileAPI/#file-constructor" />
171cb0ef41Sopenharmony_ci<link
181cb0ef41Sopenharmony_ci  rel="author"
191cb0ef41Sopenharmony_ci  title="Benjamin C. Wiley Sittler"
201cb0ef41Sopenharmony_ci  href="mailto:bsittler@chromium.org"
211cb0ef41Sopenharmony_ci/>
221cb0ef41Sopenharmony_ci<script src="/resources/testharness.js"></script>
231cb0ef41Sopenharmony_ci<script src="/resources/testharnessreport.js"></script>
241cb0ef41Sopenharmony_ci<script src="../support/send-file-formdata-helper.js"></script>
251cb0ef41Sopenharmony_ci<script>
261cb0ef41Sopenharmony_ci  "use strict";
271cb0ef41Sopenharmony_ci
281cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
291cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
301cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-NUL-[\0].txt",
311cb0ef41Sopenharmony_ci  });
321cb0ef41Sopenharmony_ci
331cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
341cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
351cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-BS-[\b].txt",
361cb0ef41Sopenharmony_ci  });
371cb0ef41Sopenharmony_ci
381cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
391cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
401cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-VT-[\v].txt",
411cb0ef41Sopenharmony_ci  });
421cb0ef41Sopenharmony_ci
431cb0ef41Sopenharmony_ci  // These have characters that undergo processing in name=,
441cb0ef41Sopenharmony_ci  // filename=, and/or value; formDataPostFileUploadTest postprocesses
451cb0ef41Sopenharmony_ci  // expectedEncodedBaseName for these internally.
461cb0ef41Sopenharmony_ci
471cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
481cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
491cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-LF-[\n].txt",
501cb0ef41Sopenharmony_ci  });
511cb0ef41Sopenharmony_ci
521cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
531cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
541cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-LF-CR-[\n\r].txt",
551cb0ef41Sopenharmony_ci  });
561cb0ef41Sopenharmony_ci
571cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
581cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
591cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-CR-[\r].txt",
601cb0ef41Sopenharmony_ci  });
611cb0ef41Sopenharmony_ci
621cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
631cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
641cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-CR-LF-[\r\n].txt",
651cb0ef41Sopenharmony_ci  });
661cb0ef41Sopenharmony_ci
671cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
681cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
691cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-HT-[\t].txt",
701cb0ef41Sopenharmony_ci  });
711cb0ef41Sopenharmony_ci
721cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
731cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
741cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-FF-[\f].txt",
751cb0ef41Sopenharmony_ci  });
761cb0ef41Sopenharmony_ci
771cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
781cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
791cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-DEL-[\x7F].txt",
801cb0ef41Sopenharmony_ci  });
811cb0ef41Sopenharmony_ci
821cb0ef41Sopenharmony_ci  // The rest should be passed through unmodified:
831cb0ef41Sopenharmony_ci
841cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
851cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
861cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-ESC-[\x1B].txt",
871cb0ef41Sopenharmony_ci  });
881cb0ef41Sopenharmony_ci
891cb0ef41Sopenharmony_ci  formDataPostFileUploadTest({
901cb0ef41Sopenharmony_ci    fileNameSource: "ASCII",
911cb0ef41Sopenharmony_ci    fileBaseName: "file-for-upload-in-form-SPACE-[ ].txt",
921cb0ef41Sopenharmony_ci  });
931cb0ef41Sopenharmony_ci</script>
94