Download File: Difference between revisions

From Starfish ETL
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
=External Assemblies=
=External Assemblies=
To download a file a C# scripted function, you must first go to the .NET Global section, and in the External Assemblies box, enter the following: ''System.dll,System.Net.dll''
To download a file in a C# scripted function, you must first go to the .NET Global section, and in the External Assemblies box, enter the following: ''System.dll,System.Net.dll''


==C# Script to Download file as a byte array ==
==C# Script to Download file as a byte array ==

Latest revision as of 19:55, 14 November 2017

External Assemblies

To download a file in a C# scripted function, you must first go to the .NET Global section, and in the External Assemblies box, enter the following: System.dll,System.Net.dll

C# Script to Download file as a byte array

object ScriptedField()
{
	var url = "https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png";
	return new System.Net.WebClient().DownloadData(url);
}

C# Script to Download file as a Base64 string

object ScriptedField()
{
	var url = "https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png";
	return Convert.ToBase64String(new System.Net.WebClient().DownloadData(url));
}