I am creating an web application. I have to show one attachment in a button click.The attachment file resides on another server which is in the same network. when i make the coding its works well in my development machine, but when i deploy it does not work.
i am deploying the application in 192.168.a.xyz server and the mapped folder is in 192.168.a.ijk.
i have used the below code which works well in the development machine which is also in the same network.
I am creating an web application. I have to show one attachment in a button click.The attachment file resides on another server which is in the same network. when i make the coding its works well in my development machine, but when i deploy it does not work.
i am deploying the application in 192.168.a.xyz server and the mapped folder is in 192.168.a.ijk.
i have used the below code which works well in the development machine which is also in the same network.
Appreciate if anybody can help!
What I have tried:
public ActionResult GetCorporateInvoiceCopy(string attachId)
{
if (attachId.Length > 0)
{
try
{
string FileExtension = ".pdf";
string csvPath = "";
string inv = attachId;
csvPath = @"\\192.168.a.ijk\\Attached_Files\" + Path.GetFileName(inv.ToString() + FileExtension );
return File(csvPath, FileExtension);
}
catch (Exception ex)
{
throw ex;
}
}
else
{
return null;
}
}