如何將大型編碼圖像base64字符串從android發送到服務器。如何發送大型編碼base64圖像字符串從Android到Mysql
喜的朋友,
By default String value within 8000 characters is uploading to server.
But Encoded Image base64 String length is more than 8000 characters.
更超過8000個字符沒有從Android的上傳到mysql數據庫。
請給我一個解決方案..!
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Check which request we're responding to
if (requestCode == RESULT_LOAD_IMAGE) {
// Make sure the request was successful
// Log.d("Vicky","I'm out.");
display(requestCode,resultCode,data);
}
}
public void display(int requestCode, int resultCode, Intent data) {
if (resultCode == RESULT_OK && data != null && data.getData() != null) {
Uri selectedImageUri = data.getData();
Bitmap selectedImageBitmap = null;
try {
selectedImageBitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), selectedImageUri);
} catch (IOException e) {
e.printStackTrace();
}
selectedImage.setImageBitmap(selectedImageBitmap);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
selectedImageBitmap.compress(Bitmap.CompressFormat.JPEG, 100, byteArrayOutputStream);
byte[] byteArrayImage = byteArrayOutputStream.toByteArray();
encodedImage = Base64.encodeToString(byteArrayImage, Base64.DEFAULT);}}
似乎是一個問題,服務器端(MySQL的),而不是客戶端 –
我an_droid_dev –
同意我試過數據類型MEDIUMTEXT,長文本和LONGBLOB但是,它存儲最低8000個字符,但我需要超過8000個字符存儲到服務器。 –