11cb0ef41Sopenharmony_ci<!DOCTYPE html> 21cb0ef41Sopenharmony_ci<meta charset="utf-8" /> 31cb0ef41Sopenharmony_ci<title>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-form-helper.js"></script> 251cb0ef41Sopenharmony_ci<script> 261cb0ef41Sopenharmony_ci "use strict"; 271cb0ef41Sopenharmony_ci 281cb0ef41Sopenharmony_ci formPostFileUploadTest({ 291cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 301cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-NUL-[\0].txt", 311cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 321cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-NUL-[\0].txt", 331cb0ef41Sopenharmony_ci }); 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ci formPostFileUploadTest({ 361cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 371cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-BS-[\b].txt", 381cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 391cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-BS-[\b].txt", 401cb0ef41Sopenharmony_ci }); 411cb0ef41Sopenharmony_ci 421cb0ef41Sopenharmony_ci formPostFileUploadTest({ 431cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 441cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-VT-[\v].txt", 451cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 461cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-VT-[\v].txt", 471cb0ef41Sopenharmony_ci }); 481cb0ef41Sopenharmony_ci 491cb0ef41Sopenharmony_ci // These have characters that undergo processing in name=, 501cb0ef41Sopenharmony_ci // filename=, and/or value; formPostFileUploadTest postprocesses 511cb0ef41Sopenharmony_ci // expectedEncodedBaseName for these internally. 521cb0ef41Sopenharmony_ci 531cb0ef41Sopenharmony_ci formPostFileUploadTest({ 541cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 551cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-LF-[\n].txt", 561cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 571cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-LF-[\n].txt", 581cb0ef41Sopenharmony_ci }); 591cb0ef41Sopenharmony_ci 601cb0ef41Sopenharmony_ci formPostFileUploadTest({ 611cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 621cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-LF-CR-[\n\r].txt", 631cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 641cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-LF-CR-[\n\r].txt", 651cb0ef41Sopenharmony_ci }); 661cb0ef41Sopenharmony_ci 671cb0ef41Sopenharmony_ci formPostFileUploadTest({ 681cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 691cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-CR-[\r].txt", 701cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 711cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-CR-[\r].txt", 721cb0ef41Sopenharmony_ci }); 731cb0ef41Sopenharmony_ci 741cb0ef41Sopenharmony_ci formPostFileUploadTest({ 751cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 761cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-CR-LF-[\r\n].txt", 771cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 781cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-CR-LF-[\r\n].txt", 791cb0ef41Sopenharmony_ci }); 801cb0ef41Sopenharmony_ci 811cb0ef41Sopenharmony_ci formPostFileUploadTest({ 821cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 831cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-HT-[\t].txt", 841cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 851cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-HT-[\t].txt", 861cb0ef41Sopenharmony_ci }); 871cb0ef41Sopenharmony_ci 881cb0ef41Sopenharmony_ci formPostFileUploadTest({ 891cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 901cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-FF-[\f].txt", 911cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 921cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-FF-[\f].txt", 931cb0ef41Sopenharmony_ci }); 941cb0ef41Sopenharmony_ci 951cb0ef41Sopenharmony_ci formPostFileUploadTest({ 961cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 971cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-DEL-[\x7F].txt", 981cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 991cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-DEL-[\x7F].txt", 1001cb0ef41Sopenharmony_ci }); 1011cb0ef41Sopenharmony_ci 1021cb0ef41Sopenharmony_ci // The rest should be passed through unmodified: 1031cb0ef41Sopenharmony_ci 1041cb0ef41Sopenharmony_ci formPostFileUploadTest({ 1051cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 1061cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-ESC-[\x1B].txt", 1071cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 1081cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-ESC-[\x1B].txt", 1091cb0ef41Sopenharmony_ci }); 1101cb0ef41Sopenharmony_ci 1111cb0ef41Sopenharmony_ci formPostFileUploadTest({ 1121cb0ef41Sopenharmony_ci fileNameSource: "ASCII", 1131cb0ef41Sopenharmony_ci fileBaseName: "file-for-upload-in-form-SPACE-[ ].txt", 1141cb0ef41Sopenharmony_ci formEncoding: "UTF-8", 1151cb0ef41Sopenharmony_ci expectedEncodedBaseName: "file-for-upload-in-form-SPACE-[ ].txt", 1161cb0ef41Sopenharmony_ci }); 1171cb0ef41Sopenharmony_ci</script> 118