28_网络通信之通过HTTP协议实现文件上传
----------------------------------------------
1.注意,做表单提交的时候:程序代码;
<form method="post"
action="http://192.168.1.110:6118/WebGetSetTest/ManagerServlet"
enctype="multipart/form-data">
标题<input name="title" type="text"/><br/>
时长<input name="timelength" type="text"/><br/>
文件<input name="videofile" type="file"/><br/>
<input value="提交" type="submit"/>
</form>
----------------------------------------------------------------
2.注意在http://192.168.1.110:6118/WebGetSetTest/
http协议,post指定post方法的时候:boundary=-----------------
是指定的数据的分割线.根据http协议的要求:
数据之间要多加两个--号
------------------------
----------------------------------------------
1.注意,做表单提交的时候:程序代码;
<form method="post"
action="http://192.168.1.110:6118/WebGetSetTest/ManagerServlet"
enctype="multipart/form-data">
标题<input name="title" type="text"/><br/>
时长<input name="timelength" type="text"/><br/>
文件<input name="videofile" type="file"/><br/>
<input value="提交" type="submit"/>
</form>
----------------------------------------------------------------
2.注意在http://192.168.1.110:6118/WebGetSetTest/
http协议,post指定post方法的时候:boundary=-----------------
是指定的数据的分割线.根据http协议的要求:
数据之间要多加两个--号
------------------------
这篇博客详细介绍了如何在Android中通过HTTP协议实现文件上传,包括表单的创建、HTTP POST请求的构建,以及使用SocketHttpRequester类进行数据提交。博客还展示了相关代码示例,如FormFile和SocketHttpRequester类,讲解了HTTP请求头的构造和内容分隔线的使用,强调了处理大文件时避免内存溢出的重要性。
订阅专栏 解锁全文
1972

被折叠的 条评论
为什么被折叠?



