Open saikatzahid2001 opened 3 years ago
Here is the solution -> const lastIndex = file.name.lastIndexOf('.'); const cutFromExtension = file.name.slice(lastIndex, file.name.length); const newId = Date.now(); const newIdStr = newId.toString() const newFile = newIdStr.concat(cutFromExtension)
instead of -> projectStorage.ref(file.name) use -> projectStorage.ref(newFile)
Hope this bug will be highlighted to help beginners.
There is a bug in this application. If a user uploads an image with the same name firebase will send the same image twice.