我如何获得文件的完整路径 [英] How do im getting full path of file
问题描述
我想使用javascript从路径显示文件。任何人都可以帮帮我。
我想得到文件的完整路径
iframe id = ifDisplay
buttonid = btnValue
应用程序路径= D:\ MRS \
文件路径= E:\ MRS \上传\
i希望在iframe中显示来自E Drive的pdf文件。
我试过的:
1. var path = document.getElementById('ifDisplay')。src ='.. \\ Uploads \\ \\\'+ btnValue +'。pdf';
2. var path = document.getElementById('ifDisplay')。src ='.. / Uploads / '+ btnValue +'。pdf';
请点击链接,它可能对您有所帮助。
在给出绝对路径之前使用file:///。
此外,在提供前进时要小心反斜杠。
以下是本地系统中的工作代码。
< iframe src = file:/// C:\ Users \ 105800 \Downloads \ Systems - Casinolink - Slot.pdf style = height:700px; width:500px; frameborder = 0.3 > < / iframe >
希望,它会有所帮助。
谢谢。
Hi,
I want to display the file from a path using javascript. Can any one please help me.
I want to get the full path of the document
Iframe id = ifDisplay
buttonid = btnValue
Application Path = D:\MRS\
file path = E:\MRS\Uploads\
i want to display the pdf files from E Drive in iframe.
What I have tried:
1. var path = document.getElementById('ifDisplay').src = '..\\Uploads\\' + btnValue + '.pdf';
2. var path = document.getElementById('ifDisplay').src = '../Uploads/' + btnValue + '.pdf';解决方案Please follow the link , it might help you.
Use "file:///" before giving your absolute path.
Also, be careful while giving forward & backward slashes.
Below is the working code in my local system.
<iframe src="file:///C:\Users\105800\Downloads\Systems - Casinolink - Slot.pdf" style="height:700px; width:500px;" frameborder="0.3"></iframe>
Hope, it helps.
Thanks.
这篇关于我如何获得文件的完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!