我正在提供上传gp3的服务并下载它们。我想知道如何下载它们(我在Android Studio中使用)。 这是上传到存储代码:
private void uploadSelectedAudio(){
final ProgressDialog progressDialog = ProgressDialog.show(soundSelectBasic.this, "upload..", "Connecting", true);
FirebaseStorage storage = FirebaseStorage.getInstance();
String uniqueId=mCurrentUser.getUid();
StorageReference filePath = storage.getReferenceFromUrl("gs://my-project-2a397.appspot.com/audio/profile/UserID/" + uniqueId + ".3gp");
Uri uri = Uri.fromFile(new File(mFileName));
// Toast.makeText(soundSelectBasic.this,mFileName.toString(),Toast.LENGTH_LONG).show();
filePath.putFile(uri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
@Override
public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
progressDialog.dismiss();
finish();
}
});
`
答案 0 :(得分:1)
如果我正确理解了您的问题,建议您查看Firebase文档https://firebase.google.com/docs/storage/android/download-files