Closed itsboo07 closed 1 year ago
I can implement this for you. Should not be a problem to add a third argument fileName.
Right now the return value when downloading finished is the full file path (including the fileName). You should be able to use this full filePath in your flow and trigger a file rename. (See also https://discourse.nodered.org/t/renaming-a-file-in-javascript-node/10995)
please test 14.4.0 added a new property fileName
@windkh thanks for responding, sorry for late response, i did check but now i cant even able to save file locally...before i used the same code to save files.
msg.payload.download = {
fileId: msg.originalMessage.document.file_id,
filePath: "/config/tmp/"
//fileName: "tele.jpg"
};
return msg;
edit: it works i did a mistake in node flow.. how could i save a picture from telegram ? for now im using web link to download file using http request (GET method).
I don't understand your question... you can download a file using msg.payload.download
edit: it works i did a mistake in node flow.. how could i save a picture from telegram ? for now im using web link to download file using http request (GET method).
The same is done internally by the bot when downloading files file_id --> weblink --> GET --> stream --> save
Hi iam able to download file(document) or photo but it save as file_(number+) [ example:
file_1
] is their any way to rename or save the file or photo with the name we want.. i want to keep replacing on the existing file soo having same filename could be useful code i use to download documents