June 2018
Beginner to intermediate
394 pages
9h 2m
English
Developers can update the metadata at any time on successful file upload. Using the updateMetadata() method with specific properties and with new metadata, we can update the metadata. For instance, consider the following code:
//storage reference from our appStorageReference storageRef = storage.getReference();//reference to the fileStorageReference forestRef = storageRef.child("images/forest.jpg");//metadata including the content typeStorageMetadata metadata = new StorageMetadata.Builder() .setContentType("pictures/jpg") .setCustomMetadata("myCustomProperty", "myNewValue") .build();// Update propertiesforestRef.updateMetadata(metadata) .addOnSuccessListener(new OnSuccessListener<StorageMetadata>() { @Override ...
Read now
Unlock full access