Questions tagged «httpurlconnection»

HttpURLConnection实例用于发出单个请求,但与HTTP服务器的基础网络连接可以由其他实例透明共享。

3
使用httpurlconnection multipart / form-data上传arraylist
我需要Arraylist在不使用任何库的情况下将图像上传到服务器。我正在Asynctask上传单个图像,并且在httpurlconnection multipart / form-data的帮助下可以完美地工作。现在我需要更改代码以通过使用来上传任何类型的多个文件,Arraylist<String>但是我的问题是现有代码FileinputStream不支持arraylist,而且我不知道该怎么用,而不是Fileinputstream将arraylist上载到服务器并且我不知道想要为此使用任何库。 public class multipart_test extends AsyncTask<Void,Void,String> { Context context; String Images; public static final String TAG = "###Image Uploading###"; public multipart_test(Context context,String Upload_Images) { this.context = context; this.Images = Upload_Images; } @Override protected String doInBackground(Void... params) { BufferedReader reader; String WebPath = null; try { String lineEnd …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.