Closed afzal-lakdawala closed 9 years ago
Hi Afzal, it depends on the way you are copying the image. The library supports both drag&drop and copy+paste in a textarea. When using dragdrop the filename is available, but when copy pasting the image then the filename is not available because then its just a blob of data.
Because the filename is not always available (and irrelevant if only used to link to an image) i decided to use a "random" number which is being done at this line
This cannot be resolved in the current version of the library, i suggest to add a new method which is being fired when a filename is being generated, something like:
/**
* @param {String} filename Filename when drag&drop, null when copy+paste
*/
onGenerateFilename: function(filename) {
if(!filename) {
return 'random-filename.jpg'
}
return filename;
}
Thanks for reply. But whatever i had drag so it should take same exact name.
Also this onGenerateFilename not working.
I agree that the filename should be used when the name is available, i will keep this issue open as a todo to add this functionality in the future.
The onGenerateFilename
method is not available yet and was merely a suggestion for a way to fix the issue with a new PR.
Okay... I will spend some time onto this and send you PR for this issue.
Fixed in v2
Which method should to use for same filename output and stored for e.g filename is "test.jpg" but after uploading it's change to "image-1388234246756.jpg". How should i resolved this.