I am working on a file management application which parses excel files from the business and uploads the latest data to the database. Is it possible to link back to that file from the webpage so that when they open it to make changes they can save it without having to look up the path to that file?
For example, if i upload the file “C:\some\nested\directory\file.xlsx”, is there a way to open the file from online so that when I click “Save” in Excel it will pull up that path by default?
This is the code I have to open the file, which works, just without the correct path since it is downloading it as a tempororary file.
[HttpGet]
public FileStreamResult ViewFile(int id)
{
var report = _reportRepository.GetById(id);
var file = System.IO.File.Open(report.FilePath, FileMode.Open);
return File(file, "application/vnd-ms-excel", report.FileName);
}
Yes but not the way you are trying to.
The server needs WebDAV support to be able to do this.
Here is an example of download.
http://www.eggheadcafe.com/community/aspnet/2/10241992/downloading-file-from-webdav-with-c.aspx
MS talks about it a bit here
http://msdn.microsoft.com/en-us/library/bb397370%28v=office.12%29.aspx
https://serverfault.com/questions/52626/excel-file-always-opens-in-read-only-mode-over-webdav