Ramesh T R
Ramesh T R

Reputation: 37

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

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>";           
}

Upvotes: 0

Views: 2170

Answers (1)

emerson.marini
emerson.marini

Reputation: 9348

Only possible answer: No, you can't. For security reasons, your local files can't be accessed by the browser. Or would you like to know that some website is accessing your hard drive?

Upvotes: 1

Related Questions