{"id":22502726,"url":"https://github.com/muhammadabir64/firebase-image-uploader","last_synced_at":"2026-04-12T22:09:58.476Z","repository":{"id":157016803,"uuid":"523395753","full_name":"muhammadabir64/firebase-image-uploader","owner":"muhammadabir64","description":"A simple code sample of how to upload/retrive images from firebase storage","archived":false,"fork":false,"pushed_at":"2023-09-24T10:29:10.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T22:46:37.518Z","etag":null,"topics":["firebase","firebase-storage","javascript"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadabir64.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-10T15:23:47.000Z","updated_at":"2023-10-05T11:15:08.000Z","dependencies_parsed_at":null,"dependency_job_id":"672ebdaa-7d4a-4caf-8ca3-8f88fda10517","html_url":"https://github.com/muhammadabir64/firebase-image-uploader","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/muhammadabir64/firebase-image-uploader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadabir64%2Ffirebase-image-uploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadabir64%2Ffirebase-image-uploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadabir64%2Ffirebase-image-uploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadabir64%2Ffirebase-image-uploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadabir64","download_url":"https://codeload.github.com/muhammadabir64/firebase-image-uploader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadabir64%2Ffirebase-image-uploader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280943396,"owners_count":26417747,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["firebase","firebase-storage","javascript"],"created_at":"2024-12-06T23:21:29.056Z","updated_at":"2025-10-25T11:03:38.958Z","avatar_url":"https://github.com/muhammadabir64.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# firebase-image-uploader\n```javascript\nconst config = {\n  apiKey: \"\",\n  authDomain: \"\",\n  projectId: \"\",\n  storageBucket: \"\",\n  messagingSenderId: \"\",\n  appId: \"\",\n  databaseURL: \"\"\n};\nconst app = firebase.initializeApp(config);\n\nconst progress_bar = document.getElementById(\"progress_bar\");\nconst file = document.getElementById(\"file\");\nconst filename_generator = (Math.random() + 1).toString(36).substring(7);\n\nfile.addEventListener(\"change\", function(e){\n  let file = e.target.files[0];\n  let storageRef = firebase.storage().ref(filename_generator+file.name);\n  let task = storageRef.put(file);\n  task.on(\"state_changed\", function progress(snapshot){\n    let percentage = (snapshot.bytesTransferred/snapshot.totalBytes)*100;\n    progress_bar.innerText = Math.round(percentage)+\"%\";\n    progress_bar.style.width = Math.round(percentage)+\"%\";\n  }, function error(error){\n    console.log(error);\n  }, function complete(){\n    task.snapshot.ref.getDownloadURL().then((url) =\u003e {\n      document.getElementById(\"img_view_div\").classList.remove(\"d-none\");\n      document.getElementById(\"img_viewer\").src = url;\n      document.getElementById(\"img_url\").href = url;\n      document.getElementById(\"img_url\").innerText = url;\n      console.log(url);\n    });\n  });\n});\n```\n## set firebase storage rules\n```\nservice firebase.storage {\n  match /b/{bucket}/o {\n    match /{allPaths=**} {\n      allow read, write: if true;\n    }\n  }\n}\n```\n![Untitled design](https://user-images.githubusercontent.com/51321911/183974101-674b4048-f6a5-41ee-b3c4-89c6f2dbcdd6.gif)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadabir64%2Ffirebase-image-uploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuhammadabir64%2Ffirebase-image-uploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuhammadabir64%2Ffirebase-image-uploader/lists"}