0

How can we fetch and display images from our local drive using Javascript?

Sample Image path is:

file:///E://DCRMS_ATTACHED_FILES/sensor_images/Sunset.jpg

JS code:

var h = "<table border='0' cellpadding='1' cellspacing='4' style='font-size:.8em;'>",p=feature.attributes;
if(feature.attributes.image_name)
{   
       alert(feature.attributes.image_name);//here i'm getting complete path to display img 
    h +="<tr><th style='font-weight:bold;'><img src="+feature.attributes.image_name+" width='100%' height='100%'></img><td></td></th></tr>";
    h   +="</table>";           
}
4

1 回答 1

1

唯一可能的答案:不,你不能。出于安全原因,浏览器无法访问您的本地文件。或者您想知道某个网站正在访问您的硬盘吗?

于 2013-09-11T15:32:34.503 回答