diff --git a/src/telegram.js b/src/telegram.js index 242b2a3..5e7cb05 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -162,7 +162,7 @@ TelegramBot.prototype._formatSendData = function (type, data) { var fileName; var fileId; if (data instanceof stream.Stream) { - fileName = path.basename(data.path); + fileName = URL.parse(path.basename(data.path)).pathname; formData = {}; formData[type] = { value: data,