.net Core Get File Request
public FileResult GetFile(string fileid)
{
byte[] bytes = File.ReadAllBytes("C:\Temp.txt");
return File(bytes, System.Net.Mime.MediaTypeNames.Application.Octet, "Temp.txt");
}
.net Core Get File Request
public FileResult GetFile(string fileid)
{
byte[] bytes = File.ReadAllBytes("C:\Temp.txt");
return File(bytes, System.Net.Mime.MediaTypeNames.Application.Octet, "Temp.txt");
}
.net Core Get File Request
using System.IO;
var filePath = Path.GetTempFileName();
foreach (var formFile in Request.Form.Files)
{
if (formFile.Length > 0)
{
using (var inputStream = new FileStream(filePath, FileMode.Create))
{
// read file to stream
await formFile.CopyToAsync(inputStream);
// stream to byte array
byte[] array = new byte[inputStream.Length];
inputStream.Seek(0, SeekOrigin.Begin);
inputStream.Read(array, 0, array.Length);
// get file name
string fName = formFile.FileName;
}
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us