Python + Firebase Cloud Storage - Upload/Download Files | Pyrebase
VloĆŸit
- Äas pĆidĂĄn 29. 07. 2024
- In today's video I show just how easy it is to upload or download files from cloud storage using Firebase. Python has a handy library called "Pyrebase" which takes care of most of the details, so you need less than 10 lines of code to get started!đ LINKS AND INFO! đ
Firebase: firebase.google.com
Follow me on Github!
github.com/Dirk-Sandberg
Consider donating to me if you are able to and appreciate my content: www.paypal.me/eriksandbergsof...
Any and all donations are super appreciated! â€ïž
This video uses the following music:
Gymnopedie No 1 by Kevin MacLeod is licensed under a Creative Commons Attribution license (creativecommons.org/licenses/...)
Source: incompetech.com/music/royalty-...
Artist: incompetech.com/ - VÄda a technologie
So elegant, clean and straightforward. Nice one
Awesome, simple and straight to the point....
You are totally right, this is awesome! Thanks Erik for share this.
very clear explanation, thanks!
Simple! Easy! Fantastic!
Nice video Erik, and Happy New Year!
The best hands down. Waiting for Mapview for IOS bro!!!!!!!!!
Hey dude thanks for this information, this help me a lot. Subscribed already.
Thank you so much. it was really helpful to me
Easy and work fine... Thank you very much
Very Lucid!!! Great job man!!!!!!!
I love Python and Firebase!
Great Tut. Thank you Erik. I am finding it tricky to delete the uploaded file. Please consider adding that Tut to your next video, or just below this comment for me and anyone else who shares my predicament.
very clean man .. thnx very much
NICE WORK BROTHER, KEEP IT UP
Thanks Bro!
Thanks for this :)
tx man u saved a life here !
Awesome!
Thank you so much!!!
ê°ìŹí©ëë€. ëčì ì ëì ìì ìŽìì
íìí©ëë€ ìČë§ìì
thank you so much!
Very help full bro tnx â„
subbed today, good content
Thanks a lot...
Sweet!
Hi, instead of download the file can we get the url?
Hi Erik, which text editor are you using here?
hey , can you try with the real time data base?when i upload the data with just using push , it will auto create a random string child name for me , i think i cant retrieve the data for it
how to upload image and save it as url in firebase
Good videođ
is it possible to delete the file that i have uploaded to the firebase cloud storage using python?
. Thank you so much
how did you add pyrebase in buildozer?
Can we use the live data from firebase to loacal system ( suppose there are new users in our app and we have recomend them videos instantaly we have our recomendation system but we need there instat data which is available on my firebase storage ) can we do that ??
Is ID token necessary to pass every time we create pyrebase project.
how i can convert these images into grayscale after uploading to cloud?
how to download all image in firebase storage folder?
I created a project in firebase but their was no databaseUrl in the config please help
Hey Erik, thanks for your awesome videos. I need a help. Can you please create a video to create session and logout using kivy and mysql?
What to do for android apps????
nice one!
Thank you. it's really helpful. I need to know one think. Now days i am trying to make a mobile app. i have a web server. but i don't know. how to upload image to my web server from kivy mobile app. Please help me. How can i do?
download() missing 1 required positional argument: 'filename' getting this error please help
although i have passed the file name
How can I download all the files in a folder?
Hello dear can you please tell us how to install pyrebase , because I'm getting error and not found any solution on line. 2.54 min please tell me how you did this shortcut.
Please help me i cant run my app on android when im using pyrebase, espacially theres an error "NoModule Name google.protobuf
what do I use nowadays: pyrebase or firebase-admin?
it seems awesome but... what if I already using firebase for realtime database?
i'm a fan
AAAAAAAAAAAAAAAAAA salvou meu rolĂȘ FODA PAKCAS !!!!!!! BIRLLL !!!
what about other files like pdf etc..?
Somebody know how if just wanna access the file?
But what if you just want to load the image from firebase cloud storage without downloading it
Can i send some text file from python to firebase
It can also be used to Upload PDF Files Right?
I get "no module named pyrebase" error even tho I installed it :((
Question
Hi Erik. Thanks for the tutorials, I've learned a lot from you. If I wanted to incorporate a global high score chart for my game, would firebase be the way to go or would you recommend something else?
Firebase would do the trick!
where is the code, not able to find on github
Happy New Year!
Hey Erik, I'm having issues while downloading the files.
I can upload the files with now issues, but I can't download the files. The program runs fine (No errors) but still the file is not downloading. I have changed the rules such that a user can access only specific user files (That is their own folder) and the upload seems to work without any issues but I can't download the file. Please help me ASAP.
By the way you explained things very nice.
2 years later same problem, for some reason the downloading files doesnt support authentication
Addressing the error most people getting :
download() missing 1 required positional argument: 'filename'
Actually, in the download function, you are required to give 2 arguments. 1st- Path, 2nd - Filename
For example :
storage.child(path_on_cloud).download("./","image.jpg")
What is your mouse model name?
thank u me sirvio
Hey bro can you guide for deleting a file from storage
Da man!!
Bro download is not working plzzzz help me out
Hey can I share my iOS app with you to test with TestFlight I owe a lot to you with your videos they helped me tackle iOS mobile. Also I wanted to know if I added the Kivy-garden source code to project will that help with map view?
Sure! You can check the About section on my profile to send me an email with a link to Test Flight :)
Not sure what you mean exactly by "help with map view"
Thanks for this bro. But if we used firebase in our project and making apk using buildozer then the apk crashes. Please help me.
Hi, have you solved the problem?
It takes alot of time to view the image uploaded on firebase
But how to stream some thing online plz make video on that
Thank you for this video, do you know how to delete a file from python on firebase ?
For example i put a file on firebase storage and then i want to remove it, i tryed to do this line " storage.child(path_on_cloud).delete(path_on_cloud)" but i got an error : 'Storage' object has no attribute 'bucket'...
it's weird because i can download and put files on my storage but i can't remove them..
Have you tried ".remove" instead of ".delete". You can give try.
Hey dude, is there anyway for kivy to access iOS gallery to select pictures for the Kivy app profile pic?
Yes, it's possible. I showed a demo of this here: czcams.com/video/MkKHqX44Mv8/video.html
The problem is the code is convoluted and there are some fixes that need to be made. I was working on it for a bit but got distracted by other things :(
what about getting the uploaded file link again?
yes this is possible :- "url = storage.child(cloudfilename).get_url(None)" this get_url method will return u the url of the desired file (cloudfilename)
Does this also work for audio files.
Cause it would be a great help.
Yep, shouldn't be a problem!
can we download multiple files or a folder from cloud instead of one file
Am searching for the same any luck? please help.
Hello Erik, I'm trying to deploy it in Xcode but I get the following error "No module named 'pyrebase'" , please help me
Make sure that you are using the latest version of python.
Try installing pyrebase5
Is there a way to have the file downloaded to a specific folder and not just to the working directory?
Of course! It's saving to the working directory in the video because path_local = "my_image.jpg". If you want to put it in a subdirectory of your project called "images", just change path_local = "images/my_image.jpg". Or, you can specify an absolute path by writing something like path_local = "/path/to/somewhere/my_image.jpg"
@@erik-sandberg my download code is slightly different from yours in that it asks for a path and a filename as shown below:
for i in range(2)
filename='test'+str(i+1)+'.jpg'
location='Events/event1/'+filename
path_local= 'images/'
storage.child(location).download(path_local,filename)
The download portion of the code asks for both path and filename bt for the life of me I cannot get the downloadedfiles to go anywhere but in the working drectory.
Why u dont make a video of programin kivy app has two tabs . Upload tab and gallery tab shows all pics in the firebase
Nice idea, I'll put it on my list :)
@@erik-sandberg i am working on it now , if you make any tutorial please lemme know
brother pls the video how to changer imei number for andoid using python pls i need the video
I have a error, when I want download file, show me: TypeError: download() missing 1 required positional argument: 'filename'
same here
@@SherazManzoorOfficial I solve it this way: storage.child(path_on_cloud).download(path="path_to_save/", filename="name_image.jpg")
@@jhonona6960 thank you very much
error at this line - AttributeError: 'Storage' object has no attribute 'put' how can i resolve this
can you resolve it?
change 'put' for 'upload'
Hey man I keep having problems when I try to install pyrebase. I use pip install pyrebase. My python version is 3.8. Pls help : )
Same problem is occurring with me !!!
@@kapri_rahul use pip3.8 install Pyrebase
Hi, how would you download the entire folder? or download 1 then delete as it gets downloaded? (without knowing the filenames)
edit: this is what worked for me...
for file in files:
print(file.name)
print(storage.child(file.name).get_url(None))
storage.child(file.name).download(os.path.basename(file.name))
storage.child(file.name).delete(file.name)
everything downloads just fine but even the folder gets deleted lol (bucket/records/file1.pdf, file2.pdf... etc
What is 'files' here ??
Hi I am trying to download images from a specific folder. I tried your code but it downloads everything, even images from other folders. have you figured it out?
How can i write it , if i want to make it for android not for web
The code is the same when deploying to android. You might get some issues when using the pyrebase module on android (I did on iOS), but it's related to just the Authentication portion of pyrebase. If you're not using the authentication portion, you can edit the pyrebase module and get rid of all code related to authentication, then include it as a normal module in your python project. If you need help deploying to android -- I'll have a video coming out soon about that, or you should ask in the Kivy Discord support channels for personal help! discordapp.com/channels/423249981340778496/423250272316293120
@@erik-sandberg thanks a lot , i am waiting the video, and already joined ur Discord đ
Make a video on how to use firebase for chatting app
Hey Erik, I have a question to you. I want to download a file from my Firebase Storage but I also want to save it with it's original name (the same filename as it is in the Storage). How can I do it? Because at your tutorial I can see that you are manualy typing the name of the file that is dowloaded.
Greetings from Poland!
hey! am searching for a solution for the same, can you share if you have found any?
And the video can be thrown into the database ?))
Yep, the video can go into the database, it just takes a while cause it's rather large. Works like a charm!
@@erik-sandberg thanks
If anyone having DatabaseURL problem like i do you should create new realtime database which is abov Storage in left then you need to add that link to the config file like "databaseURL": "xxxxxx" that
thanks bro, you solved my problem
Can i upload an entire folder using this ?
Please help!
Just loop through every file in your folder!
@@erik-sandberg can you please give the following code
@@patwekaraftab
import os
entries= os.listdir('C:/Users/Kunal/Desktop/New folder (2)')
for entry in entries:
path_on_local='C:/Users/Kunal/Desktop/New folder (2)/'+entry
path_on_cloud='/images/'+entry
storage.child(path_on_cloud).put(path_on_local)
print(entry)
@@Kunal98v thanks mate
@@Kunal98v Thanks for this. But what about the code to download an entire folder from firebase?
can you post your discord again ?
Kivy's Discord channel: discordapp.com/channels/423249981340778496/423250272316293120
@@erik-sandberg not working
@@hadikachmar2556 Hmm, I wonder if that hasn't worked the whole time. Try this one instead: chat.kivy.org
No commits to pyrebase in 4 years.
Kivy is dead