Update utils.lua
This commit is contained in:
parent
5c38c4842f
commit
73f3a21904
@ -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
|
||||
end
|
||||
|
Reference in New Issue
Block a user