开发者

Process.Start not working on UAT for opening file

this works on dev as usual when I put it on UAT the code does something different. A PDF is saved on the server, the class then opens it up using the url of that file. The URL works fine if I paste it into a browser, but doesn't work from the code. Here's my code:

  Process.Start(openPath);

openPath will look like: "http://www.cbm360.net/test/temp/CBM360Report_1开发者_StackOverflow社区093750.pdf"

The file is there on the server, but it just won't open in the code. The code is inside a web method called using AJAX, if that makes any difference, I'm not sure.

Does anyone have any suggestions as to why this isn't working?

The Exception is:

 System.ComponentModel.Win32Exception: The system cannot find the file specified

Thanks!


Instead of pasting the URL into a browser (I assume this is on the server), try it directly from the command line on the server. Does it work now? Process.Start is not the same as navigating to a URL in the browser, it is more akin to running the URL from the command line. I am not sure what you are trying to achieve. Normally we would use a web request to get a pdf.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜