From 73f3a21904235398e8050e2ddbaf9a12a77c24e7 Mon Sep 17 00:00:00 2001 From: Yago Date: Fri, 27 Feb 2015 21:36:50 +0100 Subject: [PATCH] Update utils.lua --- bot/utils.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/bot/utils.lua b/bot/utils.lua index f5ef26c..efd8ccb 100644 --- a/bot/utils.lua +++ b/bot/utils.lua @@ -67,8 +67,9 @@ function download_to_file(url, file_name) } local one, c, h = http.request(options) - - local file_name = get_http_file_name(url, h) + + file_name = file_name or get_http_file_name(url, h) + local file_path = "/tmp/"..file_name print("Saved to: "..file_path) @@ -311,4 +312,4 @@ function send_document_from_url(receiver, url, cb_function, cb_extra) local file_path = download_to_file(url, false) print("File path: "..file_path) _send_document(receiver, file_path, cb_function, cb_extra) -end \ No newline at end of file +end