I can't retrieve my images in Firebase Storage, when I try to access the Url of the image, shows this message: "the X-Goog-Upload-Command header, which is not a valid X-Goog file". I can not access the files stored in Storage through the download URL. I ask for help, and the code bellow is how I'm uploading my files to the Storage and Database!
if (pmcUri != null){
// show the progress Dialog
pmcProgress = new ProgressDialog(this);
pmcProgress.setTitle("Creating your Feed");
pmcProgress.setMessage("...");
pmcProgress.show();
final StorageReference mChildStorage = pmcStorage.child("feedPhotos")
.child(pmcUri.getLastPathSegment());
mChildStorage.putFile(pmcUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
final Uri downloadUri = taskSnapshot.getUploadSessionUri();
FirebaseDatabase database = FirebaseDatabase.getInstance();
mChildStorage.getDownloadUrl();
// save infos in Database with user ID as a Reference
final DatabaseReference myRef = database.getReference("feeds").child(uid.getUid());
myRef.child("feed").setValue(setName);
assert downloadUri != null;
myRef.child("feedimg").setValue(downloadUri.toString());
myRef.child("feedkey").setValue(uid.getUid());
pmcProgress.dismiss();
Intent intent = new Intent(create_feed.this, glime.class);
startActivity(intent);
}
});
}