<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/lib/exe/css.php?s=feed" type="text/css"?>
<rss version="2.0">
    <channel xmlns:g="http://base.google.com/ns/1.0">
        <title>worldwide open-source software - software:development:web:docs:web:api:file_api</title>
        <description></description>
        <link>http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/</link>
        <lastBuildDate>Thu, 09 Apr 2026 17:25:34 +0000</lastBuildDate>
        <generator>FeedCreator 1.8</generator>
        <image>
            <url>http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/lib/exe/fetch.php?media=wiki:logo.png</url>
            <title>worldwide open-source software</title>
            <link>http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/</link>
        </image>
        <item>
            <title>using_files_from_web_applications</title>
            <link>http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;rev=1738392108</link>
            <description>
&lt;h1 class=&quot;sectionedit1&quot; id=&quot;использование_файлов_из_веб-приложений&quot;&gt;Использование файлов из веб-приложений&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;
&lt;span style=&quot;color:#ed1c24;&quot;&gt;Продолжение &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&quot; class=&quot;urlextern&quot; title=&quot;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&quot; rel=&quot;ugc nofollow&quot;&gt;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;

&lt;p&gt;
Используя File &lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt;, веб-контент может попросить пользователя выбрать локальные файлы, а затем прочитать их содержимое. Этот выбор можно сделать либо с помощью &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:element:input:file&quot; class=&quot;wikilink1&quot; title=&quot;software:development:web:docs:web:html:element:input:file&quot; data-wiki-id=&quot;software:development:web:docs:web:html:element:input:file&quot;&gt;&amp;lt;input type=&amp;quot;file&amp;quot;&amp;gt;&lt;/a&gt; элемента &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt;, либо путем перетаскивания.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435_\u0444\u0430\u0439\u043b\u043e\u0432_\u0438\u0437_\u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:1,&amp;quot;range&amp;quot;:&amp;quot;1-662&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit2&quot; id=&quot;доступ_к_выбранным_файлам&quot;&gt;Доступ к выбранным файлам&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Рассмотрим этот &lt;abbr title=&quot;HyperText Markup Language&quot;&gt;HTML&lt;/abbr&gt;:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=0&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;HTML&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code html4strict&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/input.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;file&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;input&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;multiple&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;
&lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;/abbr&gt; файлов позволяет получить доступ к &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:filelist&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:filelist&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:filelist&quot;&gt;FileList&lt;/a&gt; содержащимся &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:file&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:file&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:file&quot;&gt;File&lt;/a&gt; объектам, представляющим файлы, выбранные пользователем.
&lt;/p&gt;

&lt;p&gt;
Атрибут multipleэлемента inputпозволяет пользователю выбирать несколько файлов.
&lt;/p&gt;

&lt;p&gt;
Доступ к первому выбранному файлу с помощью классического селектора DOM:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=1&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;JS&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code javascript&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; selectedFile &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.&lt;span class=&quot;me1&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;input&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#91;&lt;/span&gt;&lt;span class=&quot;nu0&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#93;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0434\u043e\u0441\u0442\u0443\u043f_\u043a_\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c_\u0444\u0430\u0439\u043b\u0430\u043c&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:0,&amp;quot;secid&amp;quot;:2,&amp;quot;range&amp;quot;:&amp;quot;663-1508&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit3&quot; id=&quot;доступ_к_выбранным_файлам_в_случае_изменения&quot;&gt;Доступ к выбранным файлам в случае изменения&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
Также возможно (но не обязательно) получить доступ &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:filelist&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:filelist&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:filelist&quot;&gt;FileList&lt;/a&gt; через change событие. Вам нужно использовать &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:eventtarget:addeventlistener&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:eventtarget:addeventlistener&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:eventtarget:addeventlistener&quot;&gt;EventTarget.addEventListener()&lt;/a&gt; для добавления changeпрослушивателя событий, например:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=2&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;JS&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code javascript&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; inputElement &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.&lt;span class=&quot;me1&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;input&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
inputElement.&lt;span class=&quot;me1&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;change&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; handleFiles&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kw2&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;function&lt;/span&gt; handleFiles&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
  &lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; fileList &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;this&lt;/span&gt;.&lt;span class=&quot;me1&quot;&gt;files&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;coMULTI&quot;&gt;/* now you can work with the file list */&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0414\u043e\u0441\u0442\u0443\u043f \u043a \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0434\u043e\u0441\u0442\u0443\u043f_\u043a_\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u043c_\u0444\u0430\u0439\u043b\u0430\u043c_\u0432_\u0441\u043b\u0443\u0447\u0430\u0435_\u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:2,&amp;quot;secid&amp;quot;:3,&amp;quot;range&amp;quot;:&amp;quot;1509-2278&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit4&quot; id=&quot;получение_информации_о_выбранных_файлах&quot;&gt;Получение информации о выбранных файлах&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Объект &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:filelist&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:filelist&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:filelist&quot;&gt;FileList&lt;/a&gt;, предоставленный DOM, перечисляет все файлы, выбранные пользователем, каждый из которых указан как объект &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:file&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:file&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:file&quot;&gt;File&lt;/a&gt;. Вы можете определить, сколько файлов выбрал пользователь, проверив значение атрибута списка файлов length:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=3&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;JS&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code javascript&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; numFiles &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; fileList.&lt;span class=&quot;me1&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;
Отдельные &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:file&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:file&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:file&quot;&gt;File&lt;/a&gt; объекты можно получить, обратившись к списку как к массиву.
&lt;/p&gt;

&lt;p&gt;
Объект предоставляет три атрибута &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:file&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:file&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:file&quot;&gt;File&lt;/a&gt;, которые содержат полезную информацию о файле.
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:attributes:name&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:html:attributes:name&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:html:attributes:name&quot;&gt;name&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Имя файла в виде строки, доступной только для чтения. Это просто имя файла, не содержащее никакой информации о пути.
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:attributes:size&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:html:attributes:size&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:html:attributes:size&quot;&gt;size&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
Размер файла в байтах как 64-битное целое число, доступное только для чтения.
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:attributes:type&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:html:attributes:type&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:html:attributes:type&quot;&gt;type&lt;/a&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
MIME-тип файла в виде строки, доступной только для чтения, или &lt;code&gt;«»&lt;/code&gt; если тип не может быть определен.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u0430\u0445&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435_\u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438_\u043e_\u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445_\u0444\u0430\u0439\u043b\u0430\u0445&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:3,&amp;quot;secid&amp;quot;:4,&amp;quot;range&amp;quot;:&amp;quot;2279-4054&amp;quot;} --&gt;
&lt;h3 class=&quot;sectionedit5&quot; id=&quot;примеротображение_размера_файла_ов&quot;&gt;Пример: отображение размера файла(ов)&lt;/h3&gt;
&lt;div class=&quot;level3&quot;&gt;

&lt;p&gt;
В следующем примере показано возможное использование свойства &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:attributes:size&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:html:attributes:size&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:html:attributes:size&quot;&gt;size&lt;/a&gt;:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=4&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;HTML&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code html4strict&quot;&gt;&lt;span class=&quot;sc2&quot;&gt;&amp;lt;!doctype html&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/html.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;lang&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;en-US&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/head.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/meta.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;meta&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;charset&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;UTF-8&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/title.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;title&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;File(s) size&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/title.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;title&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/head.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;head&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/body.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/form.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;uploadForm&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/input.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;uploadInput&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;file&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;multiple&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;label&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileNum&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;Selected files:&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;label&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;sc2&quot;&gt;&amp;lt;output &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileNum&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;0&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;output&amp;gt;&lt;/span&gt;;
        &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;label&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;for&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileSize&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;Total size:&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/label.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;label&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
        &lt;span class=&quot;sc2&quot;&gt;&amp;lt;output &lt;span class=&quot;kw3&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileSize&amp;quot;&lt;/span&gt;&amp;gt;&lt;/span&gt;0&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;output&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
      &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt;&amp;gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/input.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;input&lt;/span&gt;&lt;/a&gt; &lt;span class=&quot;kw3&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; &lt;span class=&quot;kw3&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;Send file&amp;quot;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&amp;gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/div.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;div&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/form.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;form&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
&amp;nbsp;
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
      const uploadInput = document.getElementById(&amp;quot;uploadInput&amp;quot;);
      uploadInput.addEventListener(
        &amp;quot;change&amp;quot;,
        () =&amp;gt; {
          // Calculate total size
          let numberOfBytes = 0;
          for (const file of uploadInput.files) {
            numberOfBytes += file.size;
          }
&amp;nbsp;
          // Approximate to the closest prefixed unit
          const units = [
            &amp;quot;B&amp;quot;,
            &amp;quot;KiB&amp;quot;,
            &amp;quot;MiB&amp;quot;,
            &amp;quot;GiB&amp;quot;,
            &amp;quot;TiB&amp;quot;,
            &amp;quot;PiB&amp;quot;,
            &amp;quot;EiB&amp;quot;,
            &amp;quot;ZiB&amp;quot;,
            &amp;quot;YiB&amp;quot;,
          ];
          const exponent = Math.min(
            Math.floor(Math.log(numberOfBytes) / Math.log(1024)),
            units.length - 1,
          );
          const approx = numberOfBytes / 1024 ** exponent;
          const output =
            exponent === 0
              ? `${numberOfBytes} bytes`
              : `${approx.toFixed(3)} ${
                  units[exponent]
                } (${numberOfBytes} bytes)`;
&amp;nbsp;
          document.getElementById(&amp;quot;fileNum&amp;quot;).textContent =
            uploadInput.files.length;
          document.getElementById(&amp;quot;fileSize&amp;quot;).textContent = output;
        },
        false,
      );
    &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/script.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;script&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/body.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;body&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;sc2&quot;&gt;&amp;lt;&lt;span class=&quot;sy0&quot;&gt;/&lt;/span&gt;&lt;a href=&quot;http://december.com/html/4/element/html.html&quot;&gt;&lt;span class=&quot;kw2&quot;&gt;html&lt;/span&gt;&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u041f\u0440\u0438\u043c\u0435\u0440: \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0444\u0430\u0439\u043b\u0430(\u043e\u0432)&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435_\u0440\u0430\u0437\u043c\u0435\u0440\u0430_\u0444\u0430\u0439\u043b\u0430_\u043e\u0432&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:4,&amp;quot;secid&amp;quot;:5,&amp;quot;range&amp;quot;:&amp;quot;4055-6066&amp;quot;} --&gt;
&lt;h2 class=&quot;sectionedit6&quot; id=&quot;использование_скрытых_элементов_ввода_файла_с_помощью_метода_click&quot;&gt;Использование скрытых элементов ввода файла с помощью метода click()&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;
Вы можете скрыть заведомо уродливый файловый &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:element:input&quot; class=&quot;wikilink1&quot; title=&quot;software:development:web:docs:web:html:element:input&quot; data-wiki-id=&quot;software:development:web:docs:web:html:element:input&quot;&gt;&amp;lt;input&amp;gt;&lt;/a&gt; элемент и предоставить свой собственный интерфейс для открытия средства выбора файлов и отображения файла или файлов, выбранных пользователем. Вы можете сделать это, задав стиль входному элементу &lt;code&gt;display:none&lt;/code&gt; и вызвав &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:api:htmlelement:click&quot; class=&quot;wikilink2&quot; title=&quot;software:development:web:docs:web:api:htmlelement:click&quot; rel=&quot;nofollow&quot; data-wiki-id=&quot;software:development:web:docs:web:api:htmlelement:click&quot;&gt;click()&lt;/a&gt; метод этого &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:element:input&quot; class=&quot;wikilink1&quot; title=&quot;software:development:web:docs:web:html:element:input&quot; data-wiki-id=&quot;software:development:web:docs:web:html:element:input&quot;&gt;&amp;lt;input&amp;gt;&lt;/a&gt; элемента.
&lt;/p&gt;

&lt;p&gt;
Код, обрабатывающий &lt;code&gt;click&lt;/code&gt; событие, может выглядеть так:
&lt;/p&gt;
&lt;dl class=&quot;code&quot;&gt;
&lt;dt&gt;&lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?do=export_code&amp;amp;id=software:development:web:docs:web:api:file_api:using_files_from_web_applications&amp;amp;codeblock=5&quot; title=&quot;Скачать фрагмент кода&quot; class=&quot;mediafile mf_&quot;&gt;JS&lt;/a&gt;&lt;/dt&gt;
&lt;dd&gt;&lt;pre class=&quot;code javascript&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; fileSelect &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.&lt;span class=&quot;me1&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileSelect&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;kw1&quot;&gt;const&lt;/span&gt; fileElem &lt;span class=&quot;sy0&quot;&gt;=&lt;/span&gt; document.&lt;span class=&quot;me1&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;st0&quot;&gt;&amp;quot;fileElem&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
&amp;nbsp;
fileSelect.&lt;span class=&quot;me1&quot;&gt;addEventListener&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;
  &lt;span class=&quot;st0&quot;&gt;&amp;quot;click&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;e&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;sy0&quot;&gt;=&amp;gt;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
    &lt;span class=&quot;kw1&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;fileElem&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt; &lt;span class=&quot;br0&quot;&gt;&amp;#123;&lt;/span&gt;
      fileElem.&lt;span class=&quot;me1&quot;&gt;click&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#40;&lt;/span&gt;&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;
  &lt;span class=&quot;br0&quot;&gt;&amp;#125;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
  &lt;span class=&quot;kw2&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;,&lt;/span&gt;
&lt;span class=&quot;br0&quot;&gt;&amp;#41;&lt;/span&gt;&lt;span class=&quot;sy0&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;
Вы можете стилизовать &lt;a href=&quot;http://synoinstall-2pkhywzfvulqafp3.direct.quickconnect.to/doku.php?id=software:development:web:docs:web:html:element:button&quot; class=&quot;wikilink1&quot; title=&quot;software:development:web:docs:web:html:element:button&quot; data-wiki-id=&quot;software:development:web:docs:web:html:element:button&quot;&gt;&amp;lt;button&amp;gt;&lt;/a&gt; как пожелаете.
&lt;/p&gt;

&lt;p&gt;
Продолжение &lt;a href=&quot;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&quot; class=&quot;urlextern&quot; title=&quot;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&quot; rel=&quot;ugc nofollow&quot;&gt;https://developer.mozilla.org/en-US/docs/Web/API/File_API/Using_files_from_web_applications&lt;/a&gt;
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- EDIT{&amp;quot;target&amp;quot;:&amp;quot;section&amp;quot;,&amp;quot;name&amp;quot;:&amp;quot;\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u0432\u043e\u0434\u0430 \u0444\u0430\u0439\u043b\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0435\u0442\u043e\u0434\u0430 click()&amp;quot;,&amp;quot;hid&amp;quot;:&amp;quot;\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435_\u0441\u043a\u0440\u044b\u0442\u044b\u0445_\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432_\u0432\u0432\u043e\u0434\u0430_\u0444\u0430\u0439\u043b\u0430_\u0441_\u043f\u043e\u043c\u043e\u0449\u044c\u044e_\u043c\u0435\u0442\u043e\u0434\u0430_click&amp;quot;,&amp;quot;codeblockOffset&amp;quot;:5,&amp;quot;secid&amp;quot;:6,&amp;quot;range&amp;quot;:&amp;quot;6067-&amp;quot;} --&gt;</description>
            <author>anonymous@undisclosed.example.com (Anonymous)</author>
            <pubDate>Sat, 01 Feb 2025 06:41:48 +0000</pubDate>
        </item>
    </channel>
</rss>
