firebase-storage

how to get image downloadable url from firebase storage and store in firebase database?

喜夏-厌秋 提交于 2020-01-24 19:56:27
问题 I am storing users profile pictures in firebase storage. I want to get the downloadable URL of those profile pictures and store each users profile picture URL under his/her User ID in firebase database. Here is my code for storing the picture in firebase storage. But i don't know how to get the URL and store in database under respective user's ID. I have also attached the snapshot of my firebase database. Firebase database image protected void onActivityResult(int requestCode, int resultCode,

Unable to display firebase storage images into a collectionview swift

て烟熏妆下的殇ゞ 提交于 2020-01-24 12:24:09
问题 I need some help I have been scouring the internet for help with displaying my firebase storage images in a CollectionView. I am using UIImagepicker to upload the images to firebase but they are not displaying in my CollectionView. I have tried all different type of ways but nothing has worked. This is my PhotoVC class PhotoVC: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIImagePickerControllerDelegate,

Unable to display firebase storage images into a collectionview swift

做~自己de王妃 提交于 2020-01-24 12:23:49
问题 I need some help I have been scouring the internet for help with displaying my firebase storage images in a CollectionView. I am using UIImagepicker to upload the images to firebase but they are not displaying in my CollectionView. I have tried all different type of ways but nothing has worked. This is my PhotoVC class PhotoVC: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIImagePickerControllerDelegate,

Unable to display firebase storage images into a collectionview swift

那年仲夏 提交于 2020-01-24 12:22:38
问题 I need some help I have been scouring the internet for help with displaying my firebase storage images in a CollectionView. I am using UIImagepicker to upload the images to firebase but they are not displaying in my CollectionView. I have tried all different type of ways but nothing has worked. This is my PhotoVC class PhotoVC: UIViewController, UICollectionViewDataSource, UICollectionViewDelegate, UICollectionViewDelegateFlowLayout, UIImagePickerControllerDelegate,

How to get file URL after uploading them to Firebase?

空扰寡人 提交于 2020-01-22 13:25:26
问题 Once you have uploaded a file to Firebase how can you get it's URL so that you can store that for later use? I want to write the URL to a Firebase Database so that other users can access the image. I am uploading the file like so: public void uploadFile() { StorageReference filepath = mstorageRef.child("folder").child(filename); Uri File= Uri.fromFile(new File(mFileName)); filepath.putFile(File).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() { @Override public void

How do i add multiple Images from my Firebase Database to my ArrayList

╄→尐↘猪︶ㄣ 提交于 2020-01-22 03:09:35
问题 public class getFirebase extends AppCompatActivity { DatabaseReference dbRef; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_get_firebase); dbRef = FirebaseDatabase.getInstance().getReference().child("theimage"); final List<Integer> images = new ArrayList<>(); dbRef.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull com.google.firebase.database.DataSnapshot

Reading a file from Expo's cache as base64, writing to firebase storage (Cloud Storage for Firebase)

北城余情 提交于 2020-01-22 02:26:13
问题 After using expo's ImagePicker and saving the image in the local cache, I am trying to save the image to firebase storage (or its new name, Cloud Storage for Firebase). The relevant code is: base64String = FileSystem.readAsStringAsync(photoUri, { encoding: FileSystem.EncodingTypes.Base64 }); and then ref.putString(base64String,'base64', { contentType: 'image/jpeg' }) However, something is wrong with the image that I save to firestore, and I cannot view it (either directly from the firestore

How can I generate access token to file uploaded to firebase storage?

帅比萌擦擦* 提交于 2020-01-22 00:58:26
问题 I'm able to upload a file to my firebase storage bucket via nodejs using the firebase-admin but when I go to the firebase UI I cannot open the file. I noticed that uploaded files via firebase UI will have an access token automatically generated but no for files uploaded via nodejs. I already tried several things like setting metadata with downloadtokens and making the file public after it is uploaded. None has worked. How can I generate the access token via API call rather than having to go

Firebase Storage - Wait till all upload tasks are completed before executing function

微笑、不失礼 提交于 2020-01-21 13:29:42
问题 I'm using the following code to upload one or multiple files to Firebase Storage. When the upload is completed the downloadURL is logged in the console. I would like to execute another function when all the files are uploaded, outside the forEach function. How can I print the console log when all the uploads tasks are completed? onSubmit = e => { e.preventDefault(); const { files } = this.state; files.forEach(file => { const uploadTask = Storage.ref(`files/${file.name}`).put(file); uploadTask

Firebase Storage - Wait till all upload tasks are completed before executing function

岁酱吖の 提交于 2020-01-21 13:27:13
问题 I'm using the following code to upload one or multiple files to Firebase Storage. When the upload is completed the downloadURL is logged in the console. I would like to execute another function when all the files are uploaded, outside the forEach function. How can I print the console log when all the uploads tasks are completed? onSubmit = e => { e.preventDefault(); const { files } = this.state; files.forEach(file => { const uploadTask = Storage.ref(`files/${file.name}`).put(file); uploadTask