Closed xmsz closed 1 year ago
const downloader = new Downloader({ url: "http://wx.qlogo.cn/mmhead/ver_1/89YLLIPBBfACbl3Wlanq1xkYSouia2oe5um1Hvx3QPRSdF5ddnF3uNPOnbznduFtcPycjzEZ6GsibabQqTuje1I1JOERNLCQN88q85OibSTFCw/0", directory: './download/', });
I want set custom fileName, but i can't get the file extension.
maybe, it can be this way
const downloader = new Downloader({ url: "http://wx.qlogo.cn/mmhead/ver_1/89YLLIPBBfACbl3Wlanq1xkYSouia2oe5um1Hvx3QPRSdF5ddnF3uNPOnbznduFtcPycjzEZ6GsibabQqTuje1I1JOERNLCQN88q85OibSTFCw/0", directory: './download/', fileName: ({extension}) => { return `${customFileName}.${extension}` } });
https://github.com/ibrod83/nodejs-file-downloader#get-the-deduced-file-name-and-override-it
is it working for you?
yes
I want set custom fileName, but i can't get the file extension.
maybe, it can be this way