Is there any way I can save a site from a published user PC file?

Asked

Viewed 55 times

3

I am creating a zipped file and need to save it to my user, only when I select the location where q is saved the file it saves on the server where the site is hosted.

Way

string zip = @"C:\file.zip";

Passing to be saved...

using (var fileStream = new FileStream(zip, FileMode.Create))

It has as I save direct on my user’s PC?

1 answer

2


You can perform download operation and let it choose the location to save.

public FileResult Download()
{
    byte[] fileBytes = System.IO.File.ReadAllBytes(@"c:\folder\myfile.ext");
    string fileName = "myfile.ext";
    return File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName);
}
  • Cool, I’ll use this alternative...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.