You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I hope to anyone can solve the problem I m workin on flutter web ,started a week but I got some error when I uploaded image storage and cloud store
my codes uploaded storage but image not upload store can anyone fix this situation?
service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read; allow write; } } }
firebase_core: ^0.5.3
<script src="https://www.gstatic.com/firebasejs/7.20.0/firebase-firestore.js"></script> <script src="https://www.gstatic.com/firebasejs/7.20.0/firebase-storage.js"></script>cloud_firestore: ^0.14.4
firebase: ^8.0.0
firebase_storage: ^5.2.0
Future<String>uploadBannerImageToDb(url)async{ String downloadUrl = await storage.ref(url).getDownloadURL(); if(downloadUrl!=null){ firestore.collection('slider').add({ 'image' : downloadUrl }); } return downloadUrl; }
void uploadImage({@required Function(File file) onSelected}) { InputElement uploadInput = FileUploadInputElement()..accept = "image/*"; uploadInput.click(); uploadInput.onChange.listen((event) { final file = uploadInput.files.first; final reader = FileReader(); reader.readAsDataUrl(file); reader.onLoadEnd.listen((event)async{ onSelected(file); }); }); }
void uploadStorage() { //upload selected image to firebase storage final dateTime = DateTime.now(); final path = 'bannerImage/$dateTime'; uploadImage(onSelected: (file) { if (file != null) { setState(() { _fileNameTextController.text = file.name; _imageSelected = false; _url = path; }); fb .storage() .refFromURL('gs://groceryapp-fcb53.appspot.com') .child(path) .put(file); } }); }
`
onPressed: () {
progressDialog.show();
_services
.uploadBannerImageToDb(_url)
`
Error: [firebase_storage/object-not-found] No object exists at the desired reference.
at Object.throw_ [as throw] (http://localhost:52970/dart_sdk.js:5348:11)
at reference_web.ReferenceWeb.new.getDownloadURL (http://localhost:52970/packages/firebase_storage_web/src/reference_web.dart.lib.js:84:21)
at getDownloadURL.throw ()
at http://localhost:52970/dart_sdk.js:39197:38
at _RootZone.runBinary (http://localhost:52970/dart_sdk.js:39053:58)
at _FutureListener.thenAwait.handleError (http://localhost:52970/dart_sdk.js:34046:48)
at handleError (http://localhost:52970/dart_sdk.js:34610:51)
at Function._propagateToListeners (http://localhost:52970/dart_sdk.js:34636:17)
at _Future.new.[_completeError] (http://localhost:52970/dart_sdk.js:34482:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:52970/dart_sdk.js:34521:31)
at Object._microtaskLoop (http://localhost:52970/dart_sdk.js:39335:13)
at _startMicrotaskLoop (http://localhost:52970/dart_sdk.js:39341:13)
at http://localhost:52970/dart_sdk.js:34848:9
Beta Was this translation helpful? Give feedback.
All reactions