i am trying to download an audio file in mp3 quality with tsnetgetSync Command.
The Code is simple :
Code: Select all
on mouseUp
local tRequestHeaders, tResponseHeaders, tResult, tBytes, tData
local tSettings, tCharNo, tUrl, tProxyUrl
put field "sftp_url" into tUrl
put field "sftp_username" into tSettings["username"]
put field "sftp_password" into tSettings["password"]
put empty into field "response"
-- Disable connection re-use if required
if the hilite of button "Reuse Connection" is false then
put true into tSettings["no_reuse"]
end if
put tsNetGetSync(tUrl, tRequestHeaders, tResponseHeaders, tResult, tBytes, tSettings) into tData
if tResult is not 0 then
answer "Error" && tResult && "returned from server"
end if
put tData into URL ("file:/home/michael/test.mp3")
end mouseUp
Is there a better Way to download mp3 from my Server ? I want to do this with sftp. It should work with my Indy Licence.