מחיקת קבצים באמצעות Cloud Storage באינטרנט
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
אחרי שמעלים קבצים ל-Cloud Storage, אפשר גם למחוק אותם.
מחיקת קובץ
כדי למחוק קובץ, קודם צריך ליצור הפניה לקובץ הזה. לאחר מכן קוראים ל-method delete() באותו הפניה, שמחזירה Promise שמתבצע, או שגיאה אם ה-Promise נדחה.
Web
import{getStorage,ref,deleteObject}from"firebase/storage";conststorage=getStorage();// Create a reference to the file to deleteconstdesertRef=ref(storage,'images/desert.jpg');// Delete the filedeleteObject(desertRef).then(()=>{// File deleted successfully}).catch((error)=>{// Uh-oh, an error occurred!});
// Create a reference to the file to deletevardesertRef=storageRef.child('images/desert.jpg');// Delete the filedesertRef.delete().then(()=>{// File deleted successfully}).catch((error)=>{// Uh-oh, an error occurred!});
יכולות להיות כמה סיבות לשגיאות במחיקת קבצים, כולל קובץ שלא קיים או משתמש שאין לו הרשאה למחוק את הקובץ שצוין. מידע נוסף על שגיאות זמין בקטע טיפול בשגיאות במסמכים.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2026-01-23 (שעון UTC)."],[],[]]