Closed temitope closed 6 years ago
@sprmn I see it is here in the src/index.js
line 58 or so
// Ensure there is an extension in the filename if (!extractExtension(filenameToUse)) { filenameToUse += extractExtension(file.name); }
perhaps we can add a check for another prop. maybe something like allowExtensionlessFilename
?
Hi @temitope, thanks for opening an issue and feel free to add this prop and submit a PR. It shouldn't be much work.
However, could you provide some more info about your use case? Why do you need a file without extension?
@sprmn yeah, simple enough.
So for my app we were storing the urls based on userids and wanted a uniform url, so instead of processing gifs, pngs and jpegs to a single format and keeping the extension, we just leave it off and let the browser interpret the image. This allowed us to generate/know the image urls without querying the database. As I was in a bit of a rush I made some tweaks on my send so I can manage without it for now since we dont actually do this anymore, but I thought it would be nice to have. I will close this for now.
I am trying to save a file with no file extension.
i.e.
filename.jpeg
being saved tofilename_uid
however it seems that whether i use a function or just a generated string it automatically appends the default extension to what I am returning. Is this an option I am missing? Are you open to PRs?