现在很多app都用到了头像的功能,我的项目中也用到了。
头像上传分几步:
1.获取头像
2.剪裁头像
3.文件上传
4.服务器的接受保存
首先第一步,无非就是两种方式
1,拍照
2,相册选择
之前的博客中有现到,不重复,链接:
http://blog.csdn.net/w18756901575/article/details/52087242
http://blog.csdn.net/w18756901575/article/details/52085157
第二步,裁剪头像
这一步我用的时鸿洋大神的东西,是个自定的控件,不过我对其中代码进行了一点点的修改,使之更适合自己的项目,里面原理就是监听onTouchEvent来对缩放,双击事件进行相应的处理,裁剪就是根据大小,创建一个新的bitmap,当然说起来挺简单,如果没有别人的代码可以借鉴参考,估计有的搞了,在此谢谢鸿洋大神,下面是鸿洋大神的博客链接:
http://blog.csdn.net/lmj623565791/article/details/39761281
裁剪图片好像还可以调用Android自带的裁剪功能,不过我没用过,
第三步,上传图片,
上传图片不过也就是上传文件,可以将文件转化为byte数组然后进行base64转码后进行上传,在服务器接收到后,将string解码成byte数组,然后在转化为文件。
当然上传的方法有很多,肯定不止这一种 ,因为项目的Android和web接口都是我写的所已我就这样写啦…谁让自己的web技术有限呢,原来写Android的时候一直说调用接口接口,原来自己写了才知道,其实就是一个配置好servlet的java文件.⊙﹏⊙||
写接口和写Android差不过嘛,都是用Java写的,本家嘛
对了文件上传的时候如果从本地读取,会需要读取sd卡的权限,我在6.0的模拟器上测试的时候,一直有问题,找了半天才发现是因为,没有申请权限,,,设立的权限不仅仅时AndroidManifest里面的权限声明,在6.0的系统中需要用代码弹出对话框向用户申请..
贴下请求代码

    /*** 请求权限*/public void getUserPar() {
//        Log.d("测试--授权信息", ContextCompat.checkSelfPermission(this,
//                Manifest.permission.WRITE_EXTERNAL_STORAGE) + "");
//        Log.d("测试--已授权", PackageManager.PERMISSION_GRANTED + "");
//        Log.d("测试--未授权", PackageManager.PERMISSION_DENIED + "");if (ContextCompat.checkSelfPermission(this,Manifest.permission.WRITE_EXTERNAL_STORAGE)== PackageManager.PERMISSION_GRANTED && ContextCompat.checkSelfPermission(this,Manifest.permission.READ_EXTERNAL_STORAGE)== PackageManager.PERMISSION_GRANTED) {} else {ActivityCompat.requestPermissions(this,new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE},1);}}@Overridepublic void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {switch (requestCode) {case 1: {if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {L.d("同意");} else {L.d("拒绝");}return;}}}

还有文件和数组相互转化的代码

    /*** 将file文件转化为byte数组** @param filePath* @return*/public static byte[] getBytes(String filePath) {byte[] buffer = null;try {File file = new File(filePath);FileInputStream fis = new FileInputStream(file);ByteArrayOutputStream bos = new ByteArrayOutputStream(1000);byte[] b = new byte[1000];int n;while ((n = fis.read(b)) != -1) {bos.write(b, 0, n);}fis.close();bos.close();buffer = bos.toByteArray();} catch (FileNotFoundException e) {e.printStackTrace();} catch (IOException e) {e.printStackTrace();}return buffer;}/*** 将byte数组转化为file文件** @param bfile* @param filePath* @param fileName*/public static void getFile(byte[] bfile, String filePath, String fileName) {BufferedOutputStream bos = null;FileOutputStream fos = null;File file = null;try {File dir = new File(filePath);if (!dir.exists() && dir.isDirectory()) {// 判断文件目录是否存在dir.mkdirs();}file = new File(filePath + "\\" + fileName);fos = new FileOutputStream(file);bos = new BufferedOutputStream(fos);bos.write(bfile);bos.flush();} catch (Exception e) {e.printStackTrace();} finally {if (bos != null) {try {bos.close();} catch (IOException e1) {e1.printStackTrace();}}if (fos != null) {try {fos.close();} catch (IOException e1) {e1.printStackTrace();}}}}

还有base64转码的:

http://blog.csdn.net/w18756901575/article/details/51073847

嗯,好像只有这些,,没了,,end

对了还有圆角,模糊,图片压缩,,,一起放上去吧

圆形图片效果:

import android.content.Context;
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffXfermode;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.widget.ImageView;import com.yesun.league.R;
import com.yesun.league.code.utils.DimensUtils;/*** 自定义View,实现圆角,圆形等效果** @author zhy*/
public class CustomImageView extends ImageView {/*** TYPE_CIRCLE / TYPE_ROUND*/private int type;private static final int TYPE_CIRCLE = 0;private static final int TYPE_ROUND = 1;/*** 图片*/private Bitmap mSrc;/*** 圆角的大小*/private int mRadius;/*** 控件的宽度*/private int mWidth;/*** 控件的高度*/private int mHeight;public CustomImageView(Context context, AttributeSet attrs) {this(context, attrs, 0);}public CustomImageView(Context context) {this(context, null);}/*** 初始化一些自定义的参数** @param context* @param attrs* @param defStyle*/public CustomImageView(Context context, AttributeSet attrs, int defStyle) {super(context, attrs, defStyle);TypedArray a = context.getTheme().obtainStyledAttributes(attrs,R.styleable.CustomImageView, defStyle, 0);int n = a.getIndexCount();for (int i = 0; i < n; i++) {int attr = a.getIndex(i);switch (attr) {case R.styleable.CustomImageView_src:mSrc = BitmapFactory.decodeResource(getResources(),a.getResourceId(attr, 0));break;case R.styleable.CustomImageView_type:type = a.getInt(attr, 0);// 默认为Circlebreak;case R.styleable.CustomImageView_borderRadius:mRadius = a.getDimensionPixelSize(attr, (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10f,getResources().getDisplayMetrics()));// 默认为10DPbreak;}}a.recycle();}@Overridepublic void setImageBitmap(Bitmap bm) {super.setImageBitmap(bm);this.mSrc = bm;postInvalidate();}/*** 计算控件的高度和宽度*/@Overrideprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {super.onMeasure(widthMeasureSpec, heightMeasureSpec);/*** 设置宽度*/int specMode = MeasureSpec.getMode(widthMeasureSpec);int specSize = MeasureSpec.getSize(widthMeasureSpec);if (specMode == MeasureSpec.EXACTLY)// match_parent , accurate{mWidth = specSize;} else {// 由图片决定的宽int desireByImg = getPaddingLeft() + getPaddingRight()+ mSrc.getWidth();if (specMode == MeasureSpec.AT_MOST) {//wrap_contentmWidth = Math.min(desireByImg, specSize);} elsemWidth = desireByImg;}/**** 设置高度*/specMode = MeasureSpec.getMode(heightMeasureSpec);specSize = MeasureSpec.getSize(heightMeasureSpec);if (specMode == MeasureSpec.EXACTLY) {// match_parent , accuratemHeight = specSize;} else {int desire = getPaddingTop() + getPaddingBottom()+ mSrc.getHeight();if (specMode == MeasureSpec.AT_MOST) {// wrap_contentmHeight = Math.min(desire, specSize);} elsemHeight = desire;}setMeasuredDimension(mWidth, mHeight);}/*** 绘制*/@Overrideprotected void onDraw(Canvas canvas) {switch (type) {// 如果是TYPE_CIRCLE绘制圆形case TYPE_CIRCLE:int min = Math.min(mWidth, mHeight);/*** 长度如果不一致,按小的值进行压缩*/mSrc = Bitmap.createScaledBitmap(mSrc, min, min, false);canvas.drawBitmap(createCircleImage(mSrc, min), 0, 0, null);//下面是绘制圆环的,不喜欢的可以不要Paint paint=new Paint();int centre = getWidth()/2; //获取圆心的x坐标int radius = (int) (centre - DimensUtils.dp2px(getContext(),3)/2); //圆环的半径paint.setColor(0x88ffffff); //设置圆环的颜色paint.setStyle(Paint.Style.STROKE); //设置空心paint.setStrokeWidth(DimensUtils.dp2px(getContext(),3)); //设置圆环的宽度paint.setAntiAlias(true);  //消除锯齿canvas.drawCircle(centre, centre, radius, paint); //画出圆环break;case TYPE_ROUND:mSrc = Bitmap.createScaledBitmap(mSrc, mWidth, mHeight, false);canvas.drawBitmap(createRoundConerImage(mSrc), 0, 0, null);break;}}/*** 根据原图和变长绘制圆形图片** @param source* @param min* @return*/private Bitmap createCircleImage(Bitmap source, int min) {final Paint paint = new Paint();paint.setAntiAlias(true);Bitmap target = Bitmap.createBitmap(min, min, Config.ARGB_8888);/*** 产生一个同样大小的画布*/Canvas canvas = new Canvas(target);/*** 首先绘制圆形*/canvas.drawCircle(min / 2, min / 2, min / 2, paint);/*** 使用SRC_IN,参考上面的说明*/paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));//相交部分取后绘制上去的
//        paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.DST_IN));//相交部分取/*** 绘制图片*/canvas.drawBitmap(source, 0, 0, paint);return target;}/*** 根据原图添加圆角** @param source* @return*/private Bitmap createRoundConerImage(Bitmap source) {final Paint paint = new Paint();paint.setAntiAlias(true);Bitmap target = Bitmap.createBitmap(mWidth, mHeight, Config.ARGB_8888);Canvas canvas = new Canvas(target);RectF rect = new RectF(0, 0, source.getWidth(), source.getHeight());canvas.drawRoundRect(rect, mRadius, mRadius, paint);paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));canvas.drawBitmap(source, 0, 0, paint);return target;}
}

压缩,模糊都在这个工具类中,自己看吧:

import android.annotation.TargetApi;
import android.content.Context;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.PixelFormat;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RenderScript;
import android.renderscript.ScriptIntrinsicBlur;import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.IOException;/*** Created by wkk on 2016/8/23.* <p>* 工具类*/
public class BitmapUtils {//   compile 'com.yolanda.nohttp:nohttp:1.0.4'/*** 从本地读取图片** @param path* @return*/public static Bitmap getBitmapForPath(String path) {try {FileInputStream in = new FileInputStream(path);Bitmap bitmap = BitmapFactory.decodeStream(in);in.close();return bitmap;} catch (Exception e) {}return null;}/*** 获取资源文件中的图片** @param context* @param resourcesId* @return*/public static Drawable getDrawableFormResources(Context context, int resourcesId) {Resources resources = context.getResources();return new BitmapDrawable(resources, BitmapFactory.decodeResource(resources, resourcesId));}/*** 从资源文件中获取bitmap对象** @param context* @param resourcesId* @return*/public static Bitmap getBitmapFromResources(Context context, int resourcesId) {return BitmapFactory.decodeResource(context.getResources(), resourcesId);}/*** bitmap转byte数组** @param bitmap* @return*/public static byte[] getBitmapbyte(Bitmap bitmap) {ByteArrayOutputStream baos = new ByteArrayOutputStream();bitmap.compress(Bitmap.CompressFormat.PNG, 100, baos);byte[] datas = baos.toByteArray();try {baos.flush();baos.close();} catch (IOException e) {e.printStackTrace();}return datas;}/*** byte转bitmap数组** @param b* @return*/public static Bitmap getBitmaoFrombyte(byte[] b) {return BitmapFactory.decodeByteArray(b, 0, b.length);}/*** 压缩1** @param srcPath* @return*/public static Bitmap getimage(String srcPath) {BitmapFactory.Options newOpts = new BitmapFactory.Options();//开始读入图片,此时把options.inJustDecodeBounds 设回true了newOpts.inJustDecodeBounds = true;Bitmap bitmap = BitmapFactory.decodeFile(srcPath, newOpts);//此时返回bm为空newOpts.inJustDecodeBounds = false;int w = newOpts.outWidth;int h = newOpts.outHeight;//现在主流手机比较多是800*480分辨率,所以高和宽我们设置为float hh = 800f;//这里设置高度为800ffloat ww = 480f;//这里设置宽度为480f//缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可int be = 1;//be=1表示不缩放if (w > h && w > ww) {//如果宽度大的话根据宽度固定大小缩放be = (int) (newOpts.outWidth / ww);} else if (w < h && h > hh) {//如果高度高的话根据宽度固定大小缩放be = (int) (newOpts.outHeight / hh);}if (be <= 0)be = 1;newOpts.inSampleSize = be;//设置缩放比例//重新读入图片,注意此时已经把options.inJustDecodeBounds 设回false了bitmap = BitmapFactory.decodeFile(srcPath, newOpts);return compressImage(bitmap);//压缩好比例大小后再进行质量压缩}/*** 压缩2** @param image* @return*/public static Bitmap comp(Bitmap image) {ByteArrayOutputStream baos = new ByteArrayOutputStream();image.compress(Bitmap.CompressFormat.JPEG, 100, baos);if (baos.toByteArray().length / 1024 > 1024) {//判断如果图片大于1M,进行压缩避免在生成图片(BitmapFactory.decodeStream)时溢出baos.reset();//重置baos即清空baosimage.compress(Bitmap.CompressFormat.JPEG, 50, baos);//这里压缩50%,把压缩后的数据存放到baos中}ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());BitmapFactory.Options newOpts = new BitmapFactory.Options();//开始读入图片,此时把options.inJustDecodeBounds 设回true了newOpts.inJustDecodeBounds = true;Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, newOpts);newOpts.inJustDecodeBounds = false;int w = newOpts.outWidth;int h = newOpts.outHeight;//现在主流手机比较多是800*480分辨率,所以高和宽我们设置为float hh = 800f;//这里设置高度为800ffloat ww = 480f;//这里设置宽度为480f//缩放比。由于是固定比例缩放,只用高或者宽其中一个数据进行计算即可int be = 1;//be=1表示不缩放if (w > h && w > ww) {//如果宽度大的话根据宽度固定大小缩放be = (int) (newOpts.outWidth / ww);} else if (w < h && h > hh) {//如果高度高的话根据宽度固定大小缩放be = (int) (newOpts.outHeight / hh);}if (be <= 0)be = 1;newOpts.inSampleSize = be;//设置缩放比例newOpts.inPreferredConfig = Bitmap.Config.RGB_565;//降低图片从ARGB888到RGB565//重新读入图片,注意此时已经把options.inJustDecodeBounds 设回false了isBm = new ByteArrayInputStream(baos.toByteArray());bitmap = BitmapFactory.decodeStream(isBm, null, newOpts);return compressImage(bitmap);//压缩好比例大小后再进行质量压缩}/*** 质量压缩** @param image* @return*/public static Bitmap compressImage(Bitmap image) {ByteArrayOutputStream baos = new ByteArrayOutputStream();image.compress(Bitmap.CompressFormat.JPEG, 100, baos);//质量压缩方法,这里100表示不压缩,把压缩后的数据存放到baos中int options = 100;while (baos.toByteArray().length / 1024 > 100) {    //循环判断如果压缩后图片是否大于100kb,大于继续压缩baos.reset();//重置baos即清空baosoptions -= 10;//每次都减少10image.compress(Bitmap.CompressFormat.JPEG, options, baos);//这里压缩options%,把压缩后的数据存放到baos中}ByteArrayInputStream isBm = new ByteArrayInputStream(baos.toByteArray());//把压缩后的数据baos存放到ByteArrayInputStream中Bitmap bitmap = BitmapFactory.decodeStream(isBm, null, null);//把ByteArrayInputStream数据生成图片return bitmap;}/*** 获取图片大小** @param bitmap* @return*/public static long getBitmapsize(Bitmap bitmap) {if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) {return bitmap.getByteCount();}return bitmap.getRowBytes() * bitmap.getHeight();}/*** 对图片进行模糊处理** @param bitmap* @param context* @return*/@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)public static Bitmap blurBitmap(Bitmap bitmap, Context context) {Bitmap outBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);RenderScript rs = RenderScript.create(context.getApplicationContext());ScriptIntrinsicBlur blurScript = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs));Allocation allIn = Allocation.createFromBitmap(rs, bitmap);Allocation allOut = Allocation.createFromBitmap(rs, outBitmap);blurScript.setRadius(25f);blurScript.setInput(allIn);blurScript.forEach(allOut);allOut.copyTo(outBitmap);bitmap.recycle();rs.destroy();return outBitmap;}public static Bitmap drawableToBitmap(Drawable drawable) {Bitmap bitmap = Bitmap.createBitmap(drawable.getIntrinsicWidth(),drawable.getIntrinsicHeight(),drawable.getOpacity() != PixelFormat.OPAQUE ? Bitmap.Config.ARGB_8888 : Bitmap.Config.RGB_565);Canvas canvas = new Canvas(bitmap);//canvas.setBitmap(bitmap);drawable.setBounds(0, 0, drawable.getIntrinsicWidth(), drawable.getIntrinsicHeight());drawable.draw(canvas);return bitmap;}/*** 水平方向模糊度*/private static float hRadius = 10;/*** 竖直方向模糊度*/private static float vRadius = 10;/*** 模糊迭代度*/private static int iterations = 7;private static float a = 1.3f;/*** 模糊图片* @param bmp* @return*/public static Drawable BoxBlurFilter(Bitmap bmp) {hRadius = hRadius * a;vRadius = vRadius * a;iterations = (int) (iterations * a);int width = bmp.getWidth();int height = bmp.getHeight();int[] inPixels = new int[width * height];int[] outPixels = new int[width * height];Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);bmp.getPixels(inPixels, 0, width, 0, 0, width, height);for (int i = 0; i < iterations; i++) {blur(inPixels,outPixels, width, height, hRadius);blur(outPixels,inPixels, height, width, vRadius);}blurFractional(inPixels,outPixels, width, height, hRadius);blurFractional(outPixels,inPixels, height, width, vRadius);bitmap.setPixels(inPixels,0,width, 0,0,width, height);Drawable drawable = new BitmapDrawable(bitmap);return drawable;}public static void blur(int[] in, int[] out, int width, int height, float radius) {int widthMinus1 = width - 1;int r = (int) radius;int tableSize = 2 * r + 1;int divide[] = new int[256 * tableSize];for (int i = 0; i < 256 * tableSize; i++)divide[i] = i / tableSize;int inIndex = 0;for (int y = 0; y < height; y++) {int outIndex = y;int ta = 0, tr = 0, tg = 0, tb = 0;for (int i = -r; i <= r; i++) {int rgb = in[inIndex + clamp(i, 0, width - 1)];ta += (rgb >> 24) & 0xff;tr += (rgb >> 16) & 0xff;tg += (rgb >> 8) & 0xff;tb += rgb & 0xff;}for (int x = 0; x < width; x++) {out[outIndex] = (divide[ta] << 24) | (divide[tr] << 16) | (divide[tg] << 8)| divide[tb];int i1 = x + r + 1;if (i1 > widthMinus1)i1 = widthMinus1;int i2 = x - r;if (i2 < 0)i2 = 0;int rgb1 = in[inIndex + i1];int rgb2 = in[inIndex + i2];ta += ((rgb1 >> 24) & 0xff) - ((rgb2 >> 24) & 0xff);tr += ((rgb1 & 0xff0000) - (rgb2 & 0xff0000)) >> 16;tg += ((rgb1 & 0xff00) - (rgb2 & 0xff00)) >> 8;tb += (rgb1 & 0xff) - (rgb2 & 0xff);outIndex += height;}inIndex += width;}}public static void blurFractional(int[] in, int[] out, int width, int height, float radius) {radius -= (int) radius;float f = 1.0f / (1 + 2 * radius);int inIndex = 0;for (int y = 0; y < height; y++) {int outIndex = y;out[outIndex] = in[0];outIndex += height;for (int x = 1; x < width - 1; x++) {int i = inIndex + x;int rgb1 = in[i - 1];int rgb2 = in[i];int rgb3 = in[i + 1];int a1 = (rgb1 >> 24)& 0xff;int r1= (rgb1 >> 16)& 0xff;int g1= (rgb1 >> 8)& 0xff;int b1= rgb1 & 0xff;int a2= (rgb2 >> 24)& 0xff;int r2= (rgb2 >> 16)& 0xff;int g2= (rgb2 >> 8)& 0xff;int b2= rgb2 & 0xff;int a3= (rgb3 >> 24)& 0xff;int r3= (rgb3 >> 16)& 0xff;int g3= (rgb3 >> 8)& 0xff;int b3= rgb3 & 0xff;a1= a2 + (int)((a1 + a3) * radius);r1= r2 + (int)((r1 + r3) * radius);g1= g2 + (int)((g1 + g3) * radius);b1= b2 + (int)((b1 + b3) * radius);a1*= f;r1*= f;g1*= f;b1*= f;out[outIndex]= (a1 << 24)| (r1 << 16)| (g1 << 8)| b1;outIndex+= height;}out[outIndex]= in[width - 1];inIndex+= width;}}public static int clamp(int x,int a,int b) {return (x< a) ? a : (x > b) ? b : x;}}

嗯哼,,真的没了,,end


2017/10/12 08:49
关于上传文件到服务器的.两种思路或者是方法.
1.将文件转成base64编码放在字段里面,像正常的http交互一样去访问服务器上传
2.将文件写入流中上传

Android 上传头像(文件)到服务器相关推荐

  1. 移动端上传大文件到服务器,android上传大文件到服务器地址

    android上传大文件到服务器地址 内容精选 换一换 安装传输工具在本地主机和Windows云服务器上分别安装数据传输工具,将文件上传到云服务器.例如QQ.exe.在本地主机和Windows云服务器 ...

  2. 一行js_Node.js 一行命令上传本地文件到服务器

    每次打包完, 都要打开 FileZilla 一顿拖拽然后才能上传代码, 那就立马撸一个自动化脚本就完事了 publish-sftp Github 传送门(~~~~顺便来骗个Star~~~~) 以后一行 ...

  3. 海量上传文件服务器端,bat批量上传ftp文件到服务器

    bat批量上传ftp文件到服务器 内容精选 换一换 服务器上云或云上迁移利用镜像导入功能,将已有的业务服务器制作成镜像后导入到云平台(当前支持vhd.vmdk.qcow2.raw等多种格式),方便企业 ...

  4. MacOS下载服务器的文件/文件夹到本地、上传本地文件到服务器

    1.从服务器下载文件或文件夹 如果要下载xx.cpp文件,则在本地终端输入: scp 用户名@主机名:xx/xxx/xx.cpp 本地路径 如果要下载dir文件夹,则在本地终端输入: scp -r 用 ...

  5. ftp服务器批量上传文件,bat批量上传ftp文件到服务器

    bat批量上传ftp文件到服务器 内容精选 换一换 CDM支持周期性自动将新增文件上传到OBS,不需要写代码,也不需要用户频繁手动上传即可使用OBS的海量存储能力进行文件备份.这里以CDM周期性备份F ...

  6. android上传本地图片到服务器上,Android使用post方式上传图片到服务器的方法

    本文实例讲述了Android使用post方式上传图片到服务器的方法.分享给大家供大家参考,具体如下: /** * 上传文件到服务器类 * * @author tom */ public class U ...

  7. php上传手机文件到服务器,安卓上传文件至PHP服务器(示例代码)

    前两个月有幸参加一次免费培训,开发了一款小软件.发现AsyncHttpClient还真是好用. 直奔主题,安卓上传文件至PHP服务器: 1.PHP端服务器: //链接数据库 include (&quo ...

  8. Android上传头像,图片剪裁,压缩图片

    点击头像的时候开始调用camera()方法 private byte[] mContent = new byte[1024];// 保存照片转换后的字节,用与上传到服务器private Bitmap ...

  9. [SecureCRT]通过SFTP方式上传本地文件到服务器

    1.在本地建一个文件夹,如:d:\My Documents,在此目录下,放入我们需要上传的文件,如:nmon_linux_x86_64 2.然后打开我们的SecureCRT工具,一次选择Options ...

最新文章

  1. Go语言写的解析器(支持json,linq,sql,net,http等)
  2. map获取数字与int比较
  3. python 实现文本自动翻译功能
  4. *【牛客 - 315D】打车(贪心,同优则立证明法)
  5. python bottle框架 运维_python bottle 框架实战教程:任务管理系统 V_1.0版 | linux系统运维...
  6. mysql using btree_mysql 索引中的USING BTREE 的意义
  7. android web view
  8. 九度OJ 1133:学分绩点 (加权平均数)
  9. Android HID触摸屏驱动怎么开发
  10. stm32f207/stm32f407擦除内部flash讲解
  11. 教你三秒钟将电脑速度提高三倍
  12. JavaScript弹窗
  13. xd设计的原型图能否导出html格式,XD-餐饮app原型设计与代码导出
  14. 北大计算机前辈徐,九年中获得国家最高科学技术奖的八位北大人
  15. 牛客练习赛28 E【斜抛运动的最大水平射程】
  16. 8.磁盘存储器的管理
  17. HDU 3374 最小 / 大表示法
  18. BZOJ 2125 最短路 仙人掌最短路
  19. san mysql,高性能MySQL :应该用SAN吗?
  20. CF Round597 Div.2

热门文章

  1. 黄金分割法求函数最小值
  2. 爬虫 + 自动化利器 selenium 之自学成才篇(二)
  3. flutter 多版本管理利器fvm的详细使用介绍
  4. 全自动爬虫,你爱了么
  5. vue3.0+ts+element-plus多页签应用模板:项目搭建
  6. ctfhub Git泄露学习
  7. Dynamic 365 子网格编辑控制列可编辑
  8. C#中如何使用Sqlite、SqliCe等本地数据库?
  9. 【python】文件读取写 open的方式with的方式 异常报错处理
  10. java8 使用拉姆达对基本数据类型集合进行分组