我在尝试使用改造将图像上传到服务器时遇到以下错误,api 接收标头授权令牌,_method = "put" 和 image = "imageName.jpg" 作为参数,其他所有内容都是可选的,任何帮助将不胜感激。
java.io.FileNotFoundException:/storage/emulated/0/Download/space-wallpaper-21.jpg:打开失败:EACCES(权限被拒绝)
userImage.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
galleryIntent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
galleryIntent.setType("*/*");
startActivityForResult(galleryIntent, RESULT_LOAD_IMG);
}
});
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMG && resultCode == RESULT_OK && null != data) {
// Get the Image from data
Uri selectedImage = data.getData();
String[] filePathColumn = {MediaStore.Images.Media.DATA};
// Get the cursor
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, …Run Code Online (Sandbox Code Playgroud)