📄 multipart.xtp
字号:
<s1 title="Multipart Forms and File Uploading"><p>Multipart forms let browsers upload files to the website. They alsohave better handling for internationalization.</p><p>Default form handling uses the application/x-www-form-urlencodedcontent type. Multipart forms use the multipart/form-data encoding.</p><example title='form.html'><form action="multipart.jsp" method="POST" enctype="multipart/form-data"><input type="file" name="file"><br><input type="submit"></form></example><p>Resin's file uploading stores the uploaded file in a temporarydirectory. A servlet can get the filename for the temporary file byretrieving the form parameter. In the example,<var/getParameter("file")/> gets the filename.</p><p>Servlets will generally copy the contents of the file to itspermanent storage, whether stored on disk or in a database.</p><example title="multipart.jsp"><%String fileName = request.getParameter("file");FileInputStream is = new FileInputStream(fileName);int ch;while ((ch = is.read()) >= 0) out.print((char) ch);is.close();%></example></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -