文件未采用正确的路径打开Pdf [英] file not take a right path for open Pdf

查看:148
本文介绍了文件未采用正确的路径打开Pdf的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

在文件夹中创建后,我已经打开了一个pdf文件.
我为此写了这段代码:-

Hello friends,

i have open an pdf file after create in folder.
me write this code for that :-

if (HttpContext.Current.Session["PDFCOD"] != null)
{
                        string PDFCODPath = Server.MapPath("~/FedExShipPDF/") + HttpContext.Current.Session["PDFCOD"].ToString();
ScriptManager.RegisterStartupScript(this, typeof(string), "New Window", "window.open('" + PDFCODPath + "')", true);
}



在这里会打开新窗口,但不会显示任何内容.当我在检阅元素中看到其给定错误时,例如
无法打开本地资源"file \\\ DCourierRateFedExShipPDF%7894582546.pdf

当我调试时,PDFCODPath将具有D://CourierRate//FedExShipPDF//7894582546.pdf


我错了.我已经在浏览器中打开pdf了..
请帮助....

谢谢... !!!



here new windows open but it not display any content. when i see in inspect element its give error like
could not open local resource " file\\\DCourierRateFedExShipPDF%7894582546.pdf

when i debuge my PDFCODPath will have D://CourierRate//FedExShipPDF//7894582546.pdf


Where i m wrong. i have tired to open pdf in browse..
Plz help..

Thank You...!!!

推荐答案

您可以只使用Repsonse.Redirect(pathToFile).
You can just use Repsonse.Redirect(pathToFile).


这篇关于文件未采用正确的路径打开Pdf的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆