REST :사진은 발리로 업로드하고 API
어떻게 내가 내 서버의 폴더 (/ 업로드)에있는 갤러리에서 사진을 업로드 할 수 있습니까? 내 나머지 API와 Volley를 사용하여이 작업을 수행 할 수 있습니까?
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == GALLERY && resultCode != 0) {
Uri mImageUri = data.getData();
Log.d("TAG", mImageUri.toString());
try {
Image = MediaStore.Images.Media.getBitmap(getActivity().getContentResolver(), mImageUri);
if (getOrientation(getActivity().getApplicationContext(), mImageUri) != 0) {
Matrix matrix = new Matrix();
matrix.postRotate(getOrientation(getActivity().getApplicationContext(), mImageUri));
if (rotateImage != null)
rotateImage.recycle();
rotateImage = Bitmap.createBitmap(Image, 0, 0, Image.getWidth(), Image.getHeight(), matrix,true);
bm = rotateImage;
iv.setImageBitmap(rotateImage);
} else{
bm = Image;
iv.setImageBitmap(Image);
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
이것은 사용자가 프로필 사진을 클릭 할 때 imageview를 설정하는 방법이지만 맨 위로 업로드/검색해야합니다.
확인이 답변 : http://stackoverflow.com/a/30616268/1281775 – Seishin
당신은 FTP 업로드를 찾고 계십니까? –
내 라이브러리 사용해보기 https://github.com/amitshekhariitbhu/Fast-Android-Networking –