javascript服务器
Uploading a file and process it in the backend in one of the most common file handling functionalities in a web app: think about uploading an avatar or an attachment.
上载文件并在后端使用Web应用程序中最常见的文件处理功能之一对其进行处理:考虑上载化身或附件。
Say we have an HTML file input element:
假设我们有一个HTML文件输入元素:
<input type="file" id="fileUpload" />
We register a change handler on the #fileUpload
DOM element, and when the user chooses an image, we trigger the handleImageUpload()
function passing in the file selected.
我们在#fileUpload
DOM元素上注册一个更改处理程序,并且当用户选择图像时,我们触发handleImageUpload()
函数传入所选文件。