Closed ghost closed 3 years ago
Image upload works well on Android 7. But it doesn't work on Android 10. The request cannot be received from the server. What is the problem?
Ion.with(this) .load(UPLOAD_URL) .setMultipartParameter("name", value) .setMultipartFile("image", "image/jpeg", new File(imageName)).asJsonObject().withResponse().setCallback((e, result) -> { if(e != null) { Toast.makeText(this, "Error is: " + e.getMessage(), Toast.LENGTH_SHORT).show(); } else { switch (result.getHeaders().code()) { case 500: Toast.makeText(this, "Image Uploading Failed. Unknown Server Error.", Toast.LENGTH_SHORT).show(); break; case 200: Toast.makeText(this, "success", Toast.LENGTH_SHORT).show(); break; } } });
Image upload works well on Android 7. But it doesn't work on Android 10. The request cannot be received from the server. What is the problem?
Ion.with(this) .load(UPLOAD_URL) .setMultipartParameter("name", value) .setMultipartFile("image", "image/jpeg", new File(imageName)).asJsonObject().withResponse().setCallback((e, result) -> { if(e != null) { Toast.makeText(this, "Error is: " + e.getMessage(), Toast.LENGTH_SHORT).show(); } else { switch (result.getHeaders().code()) { case 500: Toast.makeText(this, "Image Uploading Failed. Unknown Server Error.", Toast.LENGTH_SHORT).show(); break; case 200: Toast.makeText(this, "success", Toast.LENGTH_SHORT).show(); break; } } });