Subir imágenes a mi servicio de firebase [SPA-ENG]
Recientemente me ha tocado que en una aplicación web en la que estoy trabajando para un cliente necesito subir imágenes desde cierto rol de usuario y estas mismas imágenes se deben poder visualizar.
Recently, I had to upload images from a certain user role in a web application I'm working on for a client, and these same images must be viewable.

El inconveniente que estábamos afrontando era que no podíamos utilizar el servicio de firebase para almacenar y subir documentos pero por suerte el cliente decidió comprar el servicio y lo estuve implementando en estos días lo cual resultó muy sencillo de aplicar ya que permite utilizar el servicio a través de rutas creadas dentro de carpetas generales.
The problem we were facing was that we couldn't use the Firebase service to store and upload documents. Luckily, the client decided to purchase the service, and I implemented it recently. It turned out to be very easy to implement, as it allows the service to be used through paths created within general folders.

What I mean is that once the image is uploaded, a URL can be created that references where that same image will be hosted, and that same URL can be stored as a text string in the database, so that the only thing I need to display on the web side is the URL where the image is located. What I had to implement in the web application is to limit the image size and resolution so as not to abuse the service they provide and prevent the client from having to pay much more than expected.

These images simply create a URL that initially contains the name of the section they are referencing, followed by the date and the current name of the image when it was uploaded from the user's computer.

Firebase takes care of the rest, and you can see in the code that it is relatively simple; it requires nothing more than installing the packages offered by Firebase itself and creating the asynchronous functions to then save the URL in an array.
0
0
0.000
Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!
Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).
Consider setting @stemsocial as a beneficiary of this post's rewards if you would like to support the community and contribute to its mission of promoting science and education on Hive.