Hi,
not a 100% sure, but it might not be possible at all using Campaign's Javascript engine. Are we talking about an on premise installation of Campaign? If yes, you could try to utilize curl
curl -v -F key1=value1 -F upload=@localfilename URL
with the builtin execCommand function: https://e...