I'm probably missing something here,
But is there anyway to use the sf.net.httpRequest
to download files?
I can get all the information I need, just no way to download unless I go straight to a browser to download using the sf.file.open
which works great until it's a Vision file which takes the browser wants to load before you can download it.
Not sure that this is in the right direction
sf.net.httpRequest({
url: url,
method: 'GET',
headers: {
'Authorization': `KeyCode`,
},
contentType: "UrlEncoded",
});
- Christian Scheuer @chrscheuer2024-03-27 03:38:03.507Z
Currently,
sf.net.httpRequest
is not suitable to download binary data or large files. It's designed for operating on text-based data that needs to be parsed by a script (for example, for integrating with REST API's).What's the use case for what you need to download?
Note, if you know how to use
curl
on the command line (Terminal), you can also do stuff like in this post:Christian Scheuer @chrscheuer2024-03-27 03:47:35.565Z
I think this is a good excuse for us to look into adding a
httpDownload
action. Would probably make sense for a lot of workloads.Mitch Willard @Mitch_Willard
a
httpDownload
action would be amazing!The case we'd like to use it for is with a ticketing system we use where we have all the information about a project to be mixed, where the producers/clients can also attach their files we need to do the project.
Currently we have Soundflow doing all sorts of things using the REST API, where we canGET
,POST
, etc information to update if a project is for example being started or done.I was hoping we could access the files to speed up the workflow, particularly a script I wrote that imports all selected files with the information given by the users.
in short, I want to be able to download directly from the ticket more efficiently.
I'll look into
curl
cheers @chrscheuerChristian Scheuer @chrscheuer2024-03-27 04:51:10.423Z
Wow - nice use case indeed! Love this :)
Hopefully, going via
curl
can get you unlocked for now, but I see no reason for us not to add properhttpDownload
support.Mitch Willard @Mitch_Willard
yeah it's amazing how much Soundflow helps with this work flow, it creates/opens sessions based of the name or session file path inside of the ticket, get's producers emails to send updates, even marking the tickets status off when we finish bouncing mixes which is all automated with one soundflow button. Saves us hours a day.
- In reply tochrscheuer⬆:
Mitch Willard @Mitch_Willard
maybe I'm messing this up but is this the
curl
command to be able to download a file via a URL?sf.system.exec({ commandLine: `curl -O myURLHere`, });
with the
-O
retaining the original name of the file?or should this be the command?
sf.system.exec({ commandLine: `curl myURLHere -o fileName`, });
Christian Scheuer @chrscheuer2024-03-27 04:49:42.964Z
The 2nd option here I think should be the one yes. You can experiment in Terminal to get the right one going, and once you have it nailed down, move it into a SF script and you should be good to go.
Mitch Willard @Mitch_Willard
awesome will give it a go in Terminal and transfer it once I get it right.
- In reply tochrscheuer⬆:
Mitch Willard @Mitch_Willard
Got it working @chrscheuer
You’re the man!
Thanks for all the help.
- SIn reply toMitch_Willard⬆:SoundFlow Bot @soundflowbot
This issue is now tracked internally by SoundFlow as SF-1164