E / StorageException: A StorageException event has occurred. An unknown error has occurred, check the HTTP result code and the internal exception for the server response. Code: -13000 HttpResult: 400
E/StorageException: The server has terminated the upload session java.io.IOException: The server has terminated the upload session at com.google.firebase.storage.UploadTask.zzcyp(Unknown Source) at com.google.firebase.storage.UploadTask.zzcyo(Unknown Source) at com.google.firebase.storage.UploadTask.run(Unknown Source) at com.google.firebase.storage.StorageTask$5.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) at java.lang.Thread.run(Thread.java:856) E/MainActivity: onFailure sendFileFirebase An unknown error occurred, please check the HTTP result code and inner exception for server response.
here is the code i wrote to upload the image
FirebaseStorage storage = FirebaseStorage.getInstance(); StorageReference storageRef = storage.getReferenceFromUrl(Util.URL_STORAGE_REFERENCE).child(Util.FOLDER_STORAGE_IMG); final String name = DateFormat.format("yyyy-MM-dd_hhmmss", new Date()).toString(); StorageReference imageGalleryRef = storageReference.child(name + "_gallery"); UploadTask uploadTask = imageGalleryRef.putFile(file); uploadTask.addOnFailureListener(new OnFailureListener() { @Override public void onFailure(@NonNull Exception e) { Log.e(TAG, "onFailure sendFileFirebase " + e.getMessage()); } }).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot() { @Override public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) { Log.e(TAG, "onSuccess sendFileFirebase"); Uri downloadUrl = taskSnapshot.getDownloadUrl(); FileModel fileModel = new FileModel("img", downloadUrl.toString(), name, ""); ChatModel chatModel = new ChatModel(userModel, "", Calendar.getInstance().getTime().getTime() + "", fileModel); mFirebaseDatabaseReference.child(CHAT_REFERENCE).push().setValue(chatModel); } });
source share