Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

download file from url asp net web api c#

        var client = new HttpClient();
        var response = await client.GetAsync(@"http://localhost:9000/api/file/GetFile?filename=myPackage.zip");

        using (var stream = await response.Content.ReadAsStreamAsync())
        {
            var fileInfo = new FileInfo("myPackage.zip");
            using (var fileStream = fileInfo.OpenWrite())
            {
                await stream.CopyToAsync(fileStream);
            }
        }
Comment

PREVIOUS NEXT
Code Example
Csharp :: .net mvc c# alert to client browswer window 
Csharp :: how to use file watcher in c# 
Csharp :: dynamic convert type c# 
Csharp :: convert list to dicitonary c# 
Csharp :: if char is upper csharp 
Csharp :: c# how many lines in methods 
Csharp :: asp.net model display name 
Csharp :: unity how to load a scene 
Csharp :: c# how to refreshyour bindingsource 
Csharp :: how to pause code execution in c# 
Csharp :: c# make first letter uppercase 
Csharp :: unity chat system 
Csharp :: https port 
Csharp :: Find an item in a list by LINQ 
Csharp :: C# removing the last value of an array 
Csharp :: convert string to int and read it 
Csharp :: copy text from a text box c# 
Csharp :: c# create object with properties 
Csharp :: unity find gameobject 
Csharp :: c# array 
Csharp :: look rotation only on y axis in unity 
Csharp :: how to make unity build to not be full screen 
Csharp :: how to destroy a gameobject in c# 
Csharp :: c# read file from directory 
Csharp :: c# add char to string 
Csharp :: add mime type for woff in web.config 
Csharp :: how to check if a path is a directory or file c# 
Csharp :: how to make dictionary c# 
Csharp :: c# check lenght 
Csharp :: how to create a random vector2 in unity 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =