Android 应用中,如何使用https 实现 文件上传功能。

package com.example.wbdream.zigvine;import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.os.Environment;
import android.os.Handler;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.DividerItemDecoration;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;import com.example.wbdream.zigvine.friends.FriendsData;
import com.example.wbdream.zigvine.friends.FriendsRecyclerAdapter;
import com.example.wbdream.zigvine.https.UpLoadFile;
import com.leon.lfilepickerlibrary.LFilePicker;
import com.leon.lfilepickerlibrary.utils.Constant;import org.json.JSONException;
import org.json.JSONObject;import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;public class FriendsList extends Fragment {private List<JSONObject> mData = null;private FriendsData sc = null;private SQLiteDatabase db = null;private FriendsRecyclerAdapter friendsRecyclerAdapter = null;private static final int FILE_CODE = 0;private static final String TAG = "FriendsList";private String upLoadPath = null;@Nullable@Overridepublic View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {Log.e(TAG, "onCreateView: -----finish????-------" );setHasOptionsMenu(true);final View view = inflater.inflate(R.layout.friends_list,container,false);return view;}@Overridepublic void onActivityCreated(@Nullable Bundle savedInstanceState) {super.onActivityCreated(savedInstanceState);flushData();Log.e(TAG, "onActivityCreated: +++++===================" );//        initData();
//        RecyclerView friends_recycler = getActivity().findViewById(R.id.friends_recycler);
//        LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());
//        friends_recycler.setLayoutManager(layoutManager);
//        friendsRecyclerAdapter = new FriendsRecyclerAdapter(getContext(),mData);
//        Log.e(TAG, "onActivityCreated: ====================="+friendsRecyclerAdapter.hashCode() );
//        friendsRecyclerAdapter.setOnItemClickListener(new FriendsRecyclerAdapter.OnItemClickListener() {
//            @Override
//            public void onClick(int position) {
//                Toast.makeText(getContext(),"点击事件"+position,Toast.LENGTH_SHORT).show();
//
//                //初始化某人聊天数据
//                int uid;
//                try {
//                    uid = mData.get(position).getInt("uid");Cursor cursor = db.rawQuery("select * from CHATRECORD where friends_id = "+ uid,null);
//                    Intent intent = new Intent(getContext(),ChatActivity.class);
//                    intent.putExtra("uid",uid);
//                    startActivity(intent);
//
//                } catch (JSONException e) {
//                    e.printStackTrace();
//                }
//
//            }
//        });
//        friends_recycler.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));
//        friends_recycler.setAdapter(friendsRecyclerAdapter);
//
//        //删除数据库getContext().deleteDatabase("friend1.db");
//
//        //删除表内容db.execSQL("delete from friends");
//        //插入数据
//        ContentValues values = new ContentValues();
//for ( int i=1;i<3;i++) {Log.e(TAG, "onActivityCreated: ______" + "张三" + i);values.put("friends_name","李四"+i);db.insert("FRIENDS", null,values );values.clear();}
//
//        Toast.makeText(getContext(),"初始化数据库",Toast.LENGTH_SHORT).show();
//        Cursor cursor = db.rawQuery("select friends_name,friendId from FRIENDS",null);
//        if (cursor.moveToFirst()){
//            do {
//                String name = cursor.getString(cursor.getColumnIndex("friends_name"));
//                Log.e(TAG, "onActivityCreated: *******"+name +"----"+cursor.getInt(cursor.getColumnIndex("friendId")));
//            }while(cursor.moveToNext());
//
//        }
//        cursor.close();}//添加menu@Overridepublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {inflater.inflate(R.menu.friend_list_menu,menu);}//menu点击事件@Overridepublic boolean onOptionsItemSelected(MenuItem item) {switch (item.getItemId()){case R.id.add_friend://跳转页面Toast.makeText(getContext(),"add friend",Toast.LENGTH_SHORT).show();Intent intent = new Intent(getContext(),AddFriendActivity.class);startActivity(intent);break;}return true;}public void initData() {//创建数据库sc = new FriendsData(getContext(),"friend.db",null,4);db = sc.getWritableDatabase();mData = new ArrayList();Cursor cursor = db.rawQuery("select * from FRIENDS",null);if (cursor.moveToFirst()){do {JSONObject json=new JSONObject();try {
//                    Log.e(TAG, "initData: _________" +cursor.getString(cursor.getColumnIndex("friends_name")));json.put("user_name",cursor.getString(cursor.getColumnIndex("friends_name")));json.put("message","你好呀!");json.put("imageView","");json.put("uid",cursor.getInt(cursor.getColumnIndex("friendId")));} catch (JSONException e) {e.printStackTrace();}mData.add(json);
//                Log.e(TAG, "initData: ++++"+mData.size() );}while(cursor.moveToNext());}cursor.close();}@Overridepublic void onResume() {Log.e(TAG, "onResume: --------resume------"+friendsRecyclerAdapter.hashCode() );Log.e(TAG, "onResume: ==========="+mData.size() );flushData();super.onResume();}//刷新数据public void flushData(){initData();RecyclerView friends_recycler = getActivity().findViewById(R.id.friends_recycler);LinearLayoutManager layoutManager = new LinearLayoutManager(getContext());friends_recycler.setLayoutManager(layoutManager);friendsRecyclerAdapter = new FriendsRecyclerAdapter(getContext(),mData);Log.e(TAG, "onActivityCreated: ====================="+friendsRecyclerAdapter.hashCode() );friendsRecyclerAdapter.setOnItemClickListener(new FriendsRecyclerAdapter.OnItemClickListener() {int uid;@Overridepublic void onClick(int position) {Toast.makeText(getContext(),"点击事件"+position,Toast.LENGTH_SHORT).show();Log.e(TAG, "onClick: ----点击事件----" );//初始化某人聊天数据try {uid = mData.get(position).getInt("uid");
//                    Cursor cursor = db.rawQuery("select * from CHATRECORD where friends_id = "+ uid,null);Intent intent = new Intent(getContext(),ChatActivity.class);intent.putExtra("uid",uid);
//                    startActivity(intent);Log.e(TAG, "onClick: ----https--" );@SuppressLint("HandlerLeak") final Handler handler = new Handler(){@Overridepublic void handleMessage(Message msg) {super.handleMessage(msg);switch (msg.what){case 111:Toast.makeText(getContext(),"jjjj"+msg.obj,Toast.LENGTH_SHORT).show();break;}}};//文件传输String sdpath;
//                    sdpath = "/mnt/";
//                    sdpath = getContext().getFilesDir();Log.e(TAG, "onClick: ----————"+getContext().getFilesDir() );Log.e(TAG, "onClick: ----————"+Environment.getExternalStorageDirectory() );File file = new File(getContext().getFilesDir(),"a2.txt");Log.e(TAG, "onClick: cahgnjan ==========="+!file.exists()+"     "+getContext().getFilesDir() +getContext().getExternalCacheDir() );try {File fp=getContext().getFilesDir();if (!fp.exists()){fp.mkdirs();Log.e(TAG, "onClick: --------创建文件夹" );}getContext().getFilesDir().mkdirs();if (!file.exists()){Log.e(TAG, "onClick: ———创建不成吗—————" );file.createNewFile();System.out.print("jsdhj");Log.e(TAG, "onClick: --------创建了吗" );}FileInputStream inputStream = new FileInputStream(file);inputStream.close();FileOutputStream outputStream = new FileOutputStream(file);outputStream.write("hello".getBytes());outputStream.close();} catch (IOException e) {e.printStackTrace();}new LFilePicker().withSupportFragment(FriendsList.this).withRequestCode(Constant.ICON_STYLE_BLUE).withTitle("文件管理器")
//                            .withStartPath("/storage/emulated/0/Download")//指定初始显示路径.withStartPath(getContext().getFilesDir().toString())//指定初始显示路径.withNotFoundBooks("至少选择一个文件").start();
//###############注意这里是  GET   请求   ##########/
//                    new Thread(new Runnable() {
//
//                        @Override
//                        public void run() {
//                            getHttps();
//                        }
//                        public void getHttps(){
//                            Log.e(TAG, "getHttps:-------执行了吗------ https://192.168.1.34:8000/index/" );
//                            String https = "https://192.168.1.34:8000/index/";
//                            try {
//                                SSLContext sc = SSLContext.getInstance("TLS");
//                                sc.init(null,new TrustManager[]{new MyTrustManager()},new SecureRandom());
//                                HttpsURLConnection.setDefaultSSLSocketFactory((sc.getSocketFactory()));
//                                HttpsURLConnection.setDefaultHostnameVerifier(new MyHostnameVerifier());
//                                HttpsURLConnection conn = (HttpsURLConnection)new URL(https).openConnection();
//                                conn.setDoOutput(true);
//                                conn.setDoInput(true);
//                                Log.e(TAG, "getHttps: ++++++结果111+++++" );
//
//                                conn.connect();
//                                Log.e(TAG, "getHttps: ++++++结果2222+++++" );
//                                BufferedReader br = new BufferedReader(new InputStreamReader(conn.getInputStream()));
//                                StringBuffer sb = new StringBuffer();
//                                String line;
//                                while ((line = br.readLine())!=null){
//                                    sb.append(line);
//                                }
//                                Log.e(TAG, "getHttps: ++++++结果+++++"+sb.toString() );
//                                Message msg = new Message();
//                                msg.what=111;
//                                msg.obj=sb.toString();
//                                handler.sendMessage(msg);
//                            } catch (NoSuchAlgorithmException e) {
//                                e.printStackTrace();
//                            } catch (KeyManagementException e) {
//                                e.printStackTrace();
//                            } catch (MalformedURLException e) {
//                                e.printStackTrace();
//                            } catch (IOException e) {
//                                e.printStackTrace();
//                            }
//                        }
//                        class MyHostnameVerifier implements HostnameVerifier{
//                            @Override
//                            public boolean verify(String hostname, SSLSession session) {
//                                // TODO Auto-generated method stub
//                                return true;
//                            }
//
//                        }
//
//                        class MyTrustManager implements X509TrustManager{
//                            @Override
//                            public void checkClientTrusted(X509Certificate[] chain, String authType)
//                                    throws CertificateException {
//                                // TODO Auto-generated method stub
//                            }
//                            @Override
//                            public void checkServerTrusted(X509Certificate[] chain, String authType)
//
//                                    throws CertificateException {
//                                // TODO Auto-generated method stub
//                            }
//                            @Override
//                            public X509Certificate[] getAcceptedIssuers() {
//                                // TODO Auto-generated method stub
//                                return null;
//                            }
//
//                        }
//
//                    }).start();} catch (JSONException e) {e.printStackTrace();}}//清空聊天记录@Overridepublic void clearRecord(int position) {try {uid = mData.get(position).getInt("uid");} catch (JSONException e) {e.printStackTrace();}db.execSQL("delete from chatrecord where friends_id = "+ uid+";");Cursor cursor2 =db.rawQuery("select * from CHATRECORD ;",null);Log.e(TAG, "clearRecord: " +cursor2.moveToFirst() + db.equals(null));if (cursor2.moveToFirst()){do {Log.e(TAG, "clearRecord: 00-----"+cursor2.getString(cursor2.getColumnIndex("content")) );}while (cursor2.moveToNext());}Log.e(TAG, "clearRecord: 8888888888" +"delete from CHATRECORD where friends_id ="+ uid);}//            @Override
//            public void onLongClick(int position) {
//                Toast.makeText(getContext(),"长按事件",Toast.LENGTH_SHORT).show();
//                Log.e(TAG, "onLongClick: ___***长按事件**___" );AlertDialog.Builder builder = new AlertDialog.Builder(getContext());builder.setTitle("hahahha");builder.show();
//
//                //长按功能键
//            }});friends_recycler.addItemDecoration(new DividerItemDecoration(getContext(),DividerItemDecoration.VERTICAL));friends_recycler.setAdapter(friendsRecyclerAdapter);//删除数据库
//        getContext().deleteDatabase("friend1.db");//删除表内容
//        db.execSQL("delete from CHATRECORD");//插入数据ContentValues values = new ContentValues();//        for ( int i=1;i<3;i++) {
//            Log.e(TAG, "onActivityCreated: ______" + "张三" + i);
//            values.put("friends_name","李四"+i);
//            db.insert("FRIENDS", null,values );
//            values.clear();
//        }Toast.makeText(getContext(),"初始化数据库",Toast.LENGTH_SHORT).show();Cursor cursor = db.rawQuery("select friends_name,friendId from FRIENDS",null);if (cursor.moveToFirst()){do {String name = cursor.getString(cursor.getColumnIndex("friends_name"));Log.e(TAG, "onActivityCreated: *******"+name +"----"+cursor.getInt(cursor.getColumnIndex("friendId")));}while(cursor.moveToNext());}cursor.close();}@Overridepublic void onActivityResult(int requestCode, int resultCode, Intent data) {if (resultCode == Activity.RESULT_OK) {
//            List<String> list = data.getStringArrayListExtra("paths");
//            String path = data.getStringExtra("path");
//            String param = data.getStringExtra("param");List<String> list = null;list = data.getStringArrayListExtra(Constant.RESULT_INFO);//选中文件if (list.size()>0){for (String string: list) {Log.e(TAG, "onActivityResult: *************"+string );File file =new File(string);upLoadPath = string;//https请求new Thread(new Runnable() {@Overridepublic void run() {//################  这里是   认证所有证书    trustAllCerts信任所有的证书################### handleSSLHandshake();//################  https   POST  请求 #############httpPost("https://192.168.1.32:8000/index/up","/data/user/0/com.example.wbdream.zigvine/files/a2.txt","a2.txt");
//                            httpPost("https://192.168.1.32:8000/index/up",string,file.getName());}}).start();try {FileReader fr=new FileReader(file);byte[] bytes=new byte[1024];BufferedReader br = new BufferedReader(fr);String s="";while ((s=br.readLine())!=null){Log.e(TAG, "onActivityResult: =============="+s );}} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}}}}}/*** 往服务器上上传文本  比如log日志* @param urlstr        请求的url* @param uploadFile    log日志的路径*                                    /mnt/shell/emulated/0/LOG/LOG.log* @param newName        log日志的名字 LOG.log* @return*/public static void httpPost(String urlstr,String uploadFile,String newName) {Log.e(TAG,"urlstr="+urlstr+";uploadFile="+uploadFile+";newName="+newName );String end = "\r\n";String twoHyphens = "--";String boundary = "*****";//边界标识int TIME_OUT = 10*1000;   //超时时间HttpsURLConnection con = null;DataOutputStream ds = null;InputStream is = null;try {URL url = new URL(urlstr);con = (HttpsURLConnection) url.openConnection();Log.e(TAG, "httpPost: 1111111111" );con.setReadTimeout(TIME_OUT);con.setConnectTimeout(TIME_OUT);/* 允许Input、Output,不使用Cache */con.setDoInput(true);con.setDoOutput(true);con.setUseCaches(false);// 设置http连接属性con.setRequestMethod("POST");//请求方式con.setRequestProperty("Connection", "Keep-Alive");//在一次TCP连接中可以持续发送多份数据而不会断开连接con.setRequestProperty("Charset", "UTF-8");//设置编码con.setRequestProperty("Content-Type","multipart/form-data;boundary=" + boundary);//multipart/form-data能上传文件的编码格式Log.e(TAG, "httpPost: ------------" );ds = new DataOutputStream(con.getOutputStream());Log.e(TAG, "httpPost: 2222222222" );ds.writeBytes(twoHyphens + boundary + end);ds.writeBytes("Content-Disposition: form-data; "+ "name=\"stblog\";filename=\"" + newName + "\"" + end);ds.writeBytes(end);// 取得文件的FileInputStreamFileInputStream fStream = new FileInputStream(uploadFile);Log.e(TAG, "httpPost: 333333333333" );/* 设置每次写入1024bytes */int bufferSize = 1024;byte[] buffer = new byte[bufferSize];int length = -1;/* 从文件读取数据至缓冲区 */while ((length = fStream.read(buffer)) != -1) {/* 将资料写入DataOutputStream中 */ds.write(buffer, 0, length);}ds.writeBytes(end);ds.writeBytes(twoHyphens + boundary + twoHyphens + end);//结束fStream.close();ds.flush();/* 取得Response内容 */is = con.getInputStream();int ch;StringBuffer b = new StringBuffer();while ((ch = is.read()) != -1) {b.append((char) ch);}/* 将Response显示于Dialog */Log.e(TAG, "httpPost: ------上传成功-----");} catch (Exception e) {e.printStackTrace();Log.e(TAG, "httpPost: ======----"+e );Log.e(TAG, "httpPost: --------上传失败----" );}finally {/* 关闭DataOutputStream */if(ds!=null){try {ds.close();} catch (IOException e) {e.printStackTrace();}}if (is != null) {try {is.close();} catch (IOException e) {e.printStackTrace();}}if (con != null) {con.disconnect();}}}public static void handleSSLHandshake() {try {TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {public X509Certificate[] getAcceptedIssuers() {return new X509Certificate[0];}@Overridepublic void checkClientTrusted(X509Certificate[] certs, String authType) {}@Overridepublic void checkServerTrusted(X509Certificate[] certs, String authType) {}}};SSLContext sc = SSLContext.getInstance("TLS");// trustAllCerts信任所有的证书sc.init(null, trustAllCerts, new SecureRandom());HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {@Overridepublic boolean verify(String hostname, SSLSession session) {return true;}});} catch (Exception ignored) {}
}
}

1,往服务器上上传文本 比如log日志。

    /*** 往服务器上上传文本  比如log日志* @param urlstr        请求的url* @param uploadFile    log日志的路径*                                    /mnt/shell/emulated/0/LOG/LOG.log* @param newName        log日志的名字 LOG.log* @return*/public static void httpPost(String urlstr,String uploadFile,String newName) {Log.e(TAG,"urlstr="+urlstr+";uploadFile="+uploadFile+";newName="+newName );String end = "\r\n";String twoHyphens = "--";String boundary = "*****";//边界标识int TIME_OUT = 10*1000;   //超时时间HttpsURLConnection con = null;DataOutputStream ds = null;InputStream is = null;try {URL url = new URL(urlstr);con = (HttpsURLConnection) url.openConnection();Log.e(TAG, "httpPost: 1111111111" );con.setReadTimeout(TIME_OUT);con.setConnectTimeout(TIME_OUT);/* 允许Input、Output,不使用Cache */con.setDoInput(true);con.setDoOutput(true);con.setUseCaches(false);// 设置http连接属性con.setRequestMethod("POST");//请求方式con.setRequestProperty("Connection", "Keep-Alive");//在一次TCP连接中可以持续发送多份数据而不会断开连接con.setRequestProperty("Charset", "UTF-8");//设置编码con.setRequestProperty("Content-Type","multipart/form-data;boundary=" + boundary);//multipart/form-data能上传文件的编码格式Log.e(TAG, "httpPost: ------------" );ds = new DataOutputStream(con.getOutputStream());Log.e(TAG, "httpPost: 2222222222" );ds.writeBytes(twoHyphens + boundary + end);ds.writeBytes("Content-Disposition: form-data; "+ "name=\"stblog\";filename=\"" + newName + "\"" + end);ds.writeBytes(end);// 取得文件的FileInputStreamFileInputStream fStream = new FileInputStream(uploadFile);Log.e(TAG, "httpPost: 333333333333" );/* 设置每次写入1024bytes */int bufferSize = 1024;byte[] buffer = new byte[bufferSize];int length = -1;/* 从文件读取数据至缓冲区 */while ((length = fStream.read(buffer)) != -1) {/* 将资料写入DataOutputStream中 */ds.write(buffer, 0, length);}ds.writeBytes(end);ds.writeBytes(twoHyphens + boundary + twoHyphens + end);//结束fStream.close();ds.flush();/* 取得Response内容 */is = con.getInputStream();int ch;StringBuffer b = new StringBuffer();while ((ch = is.read()) != -1) {b.append((char) ch);}/* 将Response显示于Dialog */Log.e(TAG, "httpPost: ------上传成功-----");} catch (Exception e) {e.printStackTrace();Log.e(TAG, "httpPost: ======----"+e );Log.e(TAG, "httpPost: --------上传失败----" );}finally {/* 关闭DataOutputStream */if(ds!=null){try {ds.close();} catch (IOException e) {e.printStackTrace();}}if (is != null) {try {is.close();} catch (IOException e) {e.printStackTrace();}}if (con != null) {con.disconnect();}}}

2,信任所有的ca证书,trust All Certs

    public static void handleSSLHandshake() {try {TrustManager[] trustAllCerts = new TrustManager[]{new X509TrustManager() {public X509Certificate[] getAcceptedIssuers() {return new X509Certificate[0];}@Overridepublic void checkClientTrusted(X509Certificate[] certs, String authType) {}@Overridepublic void checkServerTrusted(X509Certificate[] certs, String authType) {}}};SSLContext sc = SSLContext.getInstance("TLS");// trustAllCerts信任所有的证书sc.init(null, trustAllCerts, new SecureRandom());HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());HttpsURLConnection.setDefaultHostnameVerifier(new HostnameVerifier() {@Overridepublic boolean verify(String hostname, SSLSession session) {return true;}});} catch (Exception ignored) {}
}

转载于:Android + https 实现 文件上传

Android + https 实现 文件上传相关推荐

  1. android 与后台实时视频,android选择视频文件上传到后台服务器

    本文实例为大家分享了android选择视频文件上传到后台服务器的具体代码,供大家参考,具体内容如下 选择本地视频文件 首先第一步打开打开相册选择视频文件: Intent intent = new In ...

  2. android webview 多文件上传,Android网页WebView图片文件上传的问题

    Android网页WebView图片文件上传的问题 发布时间:2020-07-13 22:48:15 来源:51CTO 阅读:5922 作者:拾荒者老大 在安卓下,webview上传图片点击是没用的, ...

  3. android 实现FTP文件上传

    1.若已经有服务端则无需自己配置,若无服务端用于测试的话,可以通过FileZilla Server配置一个服务端,具体如何下载配置 FileZilla Server可自行百度 我们这边只需要知道ip. ...

  4. Android Http POST文件上传之-----RFC1867协议

    RFC1867协议介绍            RFC1867协议主要是在HTTP协议的基础上为INPUT标签增加了file属性,同时限定了Form的method必须为POST,ENCTYPE必须为mu ...

  5. android webview 多文件上传,Android中的webview支持页面中的文件上传实例代码

    Android webview在默认情况下是不支持网页中的文件上传功能的: 如果在网页中有,在android webview中访问时也会出现浏览文件的按钮 但是点击按钮之后没有反应... 那么如何能够 ...

  6. android 选择视频文件 上传到后台服务器

    http://blog.csdn.net/d276031034/article/details/52652749

  7. android之文件上传

    文件上传 android中的文件上传使用的是post的提交方式. 通过httpwatcher抓一个文件上传时的包,可以更加好的明白下面的代码 //调用此方法时需要传递用户名,密码,文件路径 文件上传时 ...

  8. Android 上传图片到服务器(多文件上传)

    Android客户端的UI与<Android 上传图片到服务器(单文件上传)>唯一区别增加了多文件上传的功能. 1.Android客户端多文件上传核心代码: * 多文件上传* @param ...

  9. android使用HttpURLConnection/HttpClient实现带参数文件上传

    本文参考自[http://blog.csdn.net/crazy__chen/article/details/47703781] 在Android 2.3及以上版本,使用的是HttpURLConnec ...

最新文章

  1. ffmpeg 基本用法大全
  2. IE8的项目在IE11下 一些功能无法实现的解决方案
  3. GitHub 基本常用知识解答2
  4. 汇总Web前端开发工程师需要注意的一些开发规范
  5. c语言怎么输出线性表里元素,C语言的世界-线性表
  6. c#设计一个方法,与使用
  7. HDFS DataNode 设计实现解析
  8. 通过JS和CSS,实现网页加载中的动画效果
  9. Java基础篇:嵌套 switch 语句
  10. PHP使用 uEditor富文本编辑器
  11. android开发练习:天气应用
  12. Unity 面试题整理2020
  13. 超详细wordPress主题制作教程
  14. ansible set_fact模块
  15. 干货丨人大金仓KINGBASE云数据库全生命周期管理详解
  16. 笔记本电脑蓝牙搜索不到设备
  17. 2017双11核心技术揭秘—双十一海量数据下EagleEye的使命和挑战
  18. 报错:Warning: To load an ES module, set “type“: “module“ in the package.json or use the .mjs extension
  19. candence pcb走线等长_PCB走线角度选择 - PCB Layout 跳坑指南 - 吴川斌的博客
  20. adlds文件服务器,修改 AD LDS 配置

热门文章

  1. 团购网站的销售额是怎么来的?
  2. https双向认证访问管理后台,采用USBKEY进行系统访问的身份鉴别,KEY的证书长度大于128位,使用USBKEY登录
  3. 计算机网络犯罪和一般犯罪的不同,网络犯罪有哪些类型
  4. 抓取主板市盈率,市净率和股息率
  5. java中poi导出Excel表格(前台流文件接收)
  6. 一个故事,让你一生不再生气
  7. 一个好用的在线PDF压缩工具
  8. 书呆子rico_Excel书呆子的夏季赠品
  9. P315 GCD等于XOR UVa12176 “不难发现”的解释 以及完整推导过程
  10. Xtreme Suite Pro使用教程:浏览器插件之ActiveX开发