我正在尝试通过相机将图像捕获上传到服务器.服务器发送响应代码= 200但Image不上传到服务器.
代码是:
private boolean uploadData() { int count = this.forumThreadsB.size(); for (int i = 0; i < count; i++) { if (isPhoto) message = "Uploading Shared Items " + (i + 1) + " of " + count; else message = "Uploading Shared Items " + (i + 1) + " of " + count; progressCount = (i * 1000)/count; Hashtable,?> threadD = (Hashtable,?>)this.forumThreadsB.elementAt(i); String onlinePath = "http://xyx.com/; threadID = (String) threadD.get("devicethreadID"); Hashtable
功能:
private String getBoundaryMessage(String boundary,Hashtable
在我的应用程序中我捕获图像并将其保存到数据库.保存图像的路径用于上传图像文件.最佳答案我用这个:
public class httpClIEnt extends AsyncTask
此代码使用该库:
import org.apache.http.httpentity;import org.apache.http.httpResponse;import org.apache.http.clIEnt.ClIEntProtocolException;import org.apache.http.clIEnt.methods.httpPost;import org.apache.http.entity.mime.httpMultipartMode;import org.apache.http.entity.mime.multipartentity;import org.apache.http.entity.mime.content.fileBody;import org.apache.http.impl.clIEnt.DefaulthttpClIEnt;import org.apache.http.util.EntityUtils;import org.apache.james.mime4j.message.Message;
你可以在谷歌找到这个.如果你没找到 – 我可以发给你这个库. 总结
以上是内存溢出为你收集整理的如何在Android中将图像上传到服务器?全部内容,希望文章能够帮你解决如何在Android中将图像上传到服务器?所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)