I have no idea why this isn't working, if someone could help that'd be great. Just trying to save a file with Asp.net MVC. For some reason nothing happens when I press the button to save the file. I think it has to do with the paths I'm using but I feel like I've tried everything and nothing's working!

Here's my code:

public ActionResult ExportBid(int bidid)
        {
            BiddingLogic b1 = new BiddingLogic(_procureLib, UnitOfWorkDbContext);

            //index 0 is file path
            //index 1 is file name
            string[] fileInfo = b1.ExportBid(bidid);

            return File(fileInfo[0], System.Net.Mime.MediaTypeNames.Application.Octet, fileInfo[1]);
        }

b1.ExportBid just returns an array with 2 strings in it. Index 0 is the full file path, including the name of the file we are trying to download. Looks like:

C:\workspace\ProcureWare\trunk\Apps\ProcureWare2014\Site\ExportSaveTest-Export.json

Index 1 is the name of the file. Looks like:

ExportSaveTest-Export.json

But for some reason nothing happens when I try and download the file. Am I doing something wrong with my path manipulation? Any help is greatly appreciated.

Related posts

Recent Viewed