Click here to Skip to main content
15,888,073 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am Exporting Word Using Mail Merge Method in Web Application

and It's Working Fine in Visual Studio Debugging.

But

I am getting Wrong Path when i open it like this from another computer


When i Open Website from Remote Computer using this link ( 192.168.1.101/WebAkashada/ExportWord.aspx )


it go inside Chache and Shows Error Message "File Does Not Exist"

What I have tried:

//Template Path in word table set field data <date> <time> <city>

object strTemplatePath = "D:\\ExportToWord\\ExportInvoice\\ExportSalesInvoiceTamplate.docx";

//Result path 

strReportPath = "D:\\ExportToWord\\ExportInvoice\\ResultExportInvoice.docx";
Posted
Updated 28-Dec-17 21:58pm

What were you told yesterday about this? Your server doesn't have a D: drive.

Also, the ASP.NET code will NEVER have access to the clients filesystem at all if that's what you're trying to get to.

You seem to not understand that ASP.NET code runs entirely on the server, never on the client.
 
Share this answer
 
Comments
Akshada Sane 30-Dec-17 2:49am    
yes right...
But now what should i do for getting the path?
Dave Kreskowiak 30-Dec-17 9:52am    
If you're trying to get the path to the word document on the client, you can't. It's considered a security risk so it isn't allowed.
Quote:
I am Exporting Word Using Mail Merge Method in Web Application

First reason why it don't work: it work on your PC because you have msword installed, you server don't have msword.

C#
object strTemplatePath = "D:\\ExportToWord\\ExportInvoice\\ExportSalesInvoiceTamplate.docx";

Second reason why it don't work: C# and ASP are running on server, this path aim to your server storage that certainly does not exist.

Quote:
It's Working Fine in Visual Studio Debugging.

It work on your PC because while debugging, your PC is client and server at same time.
 
Share this answer
 
Comments
Akshada Sane 30-Dec-17 2:47am    
Then What is the solution for get the path of word file

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900