সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
Cloud Storage ফাইল আপলোড করার পরে, আপনি সেগুলি মুছতেও পারেন৷
একটি ফাইল মুছুন
একটি ফাইল মুছে ফেলতে, প্রথমে সেই ফাইলটির একটি রেফারেন্স তৈরি করুন । তারপর সেই রেফারেন্সে delete() পদ্ধতিতে কল করুন।
Kotlin
// Create a storage reference from our appvalstorageRef=storage.reference// Create a reference to the file to deletevaldesertRef=storageRef.child("images/desert.jpg")// Delete the filedesertRef.delete().addOnSuccessListener{// File deleted successfully}.addOnFailureListener{// Uh-oh, an error occurred!}
// Create a storage reference from our appStorageReferencestorageRef=storage.getReference();// Create a reference to the file to deleteStorageReferencedesertRef=storageRef.child("images/desert.jpg");// Delete the filedesertRef.delete().addOnSuccessListener(newOnSuccessListener<Void>(){@OverridepublicvoidonSuccess(VoidaVoid){// File deleted successfully}}).addOnFailureListener(newOnFailureListener(){@OverridepublicvoidonFailure(@NonNullExceptionexception){// Uh-oh, an error occurred!}});
ফাইল মুছে ফেলার ক্ষেত্রে ত্রুটি ঘটতে পারে এমন অনেকগুলি কারণ রয়েছে, যার মধ্যে ফাইলটি বিদ্যমান নেই বা ব্যবহারকারীর নির্দিষ্ট ফাইলটি মুছে ফেলার অনুমতি নেই। ত্রুটিগুলি সম্পর্কে আরও তথ্য ডক্সের হ্যান্ডেল ত্রুটি বিভাগে পাওয়া যাবে৷
[null,null,["2025-08-21 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["\u003cbr /\u003e\n\nAfter uploading files to Cloud Storage, you can also delete them.\n| **Note:** By default, a Cloud Storage for Firebase bucket requires Firebase Authentication to perform any action on the bucket's data or files. You can change your Firebase Security Rules for Cloud Storage to [allow unauthenticated access for specific situations](/docs/storage/security/rules-conditions#public). However, for most situations, we strongly recommend [restricting access and setting up robust security rules](/docs/storage/security/get-started) (especially for production apps). Note that if you use Google App Engine and have a default Cloud Storage bucket with a name format of `*.appspot.com`, you may need to consider [how your security rules impact access to App Engine files](/docs/storage/gcp-integration#security-rules-and-app-engine-files).\n\nDelete a File\n\nTo delete a file, first\n[create a reference](/docs/storage/android/create-reference)\nto that file. Then call the `delete()` method on that reference. \n\nKotlin \n\n```kotlin\n// Create a storage reference from our app\nval storageRef = storage.reference\n\n// Create a reference to the file to delete\nval desertRef = storageRef.child(\"images/desert.jpg\")\n\n// Delete the file\ndesertRef.delete().addOnSuccessListener {\n // File deleted successfully\n}.addOnFailureListener {\n // Uh-oh, an error occurred!\n}https://github.com/firebase/snippets-android/blob/391c1646eacf44d2aab3f76bcfa60dfc6c14acf1/storage/app/src/main/java/com/google/firebase/referencecode/storage/kotlin/StorageActivity.kt#L401-L412\n```\n\nJava \n\n```java\n// Create a storage reference from our app\nStorageReference storageRef = storage.getReference();\n\n// Create a reference to the file to delete\nStorageReference desertRef = storageRef.child(\"images/desert.jpg\");\n\n// Delete the file\ndesertRef.delete().addOnSuccessListener(new OnSuccessListener\u003cVoid\u003e() {\n @Override\n public void onSuccess(Void aVoid) {\n // File deleted successfully\n }\n}).addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception exception) {\n // Uh-oh, an error occurred!\n }\n});https://github.com/firebase/snippets-android/blob/391c1646eacf44d2aab3f76bcfa60dfc6c14acf1/storage/app/src/main/java/com/google/firebase/referencecode/storage/StorageActivity.java#L515-L532\n```\n| **Note:** Deleted files are typically recoverable for 7 days with [soft delete](https://cloud.google.com/storage/docs/soft-delete), which is enabled by default.\n\nHandle Errors\n\nThere are a number of reasons why errors may occur on file deletes,\nincluding the file not existing, or the user not having permission\nto delete the specified file. More information on errors can be found in the\n[Handle Errors](/docs/storage/android/handle-errors)\nsection of the docs."]]