How can i retrieve image files from a local system's My pictures folder and display those images?
Retrieve image files from local system
Collapse
X
-
for that, u have to make one function on server side which manage current folder path
and called that function from inline on that img button..
[CODE=asp]<A href='<%#Format URL1(DataBinder .Eval(Container .DataItem,"prod _id"))%>' onclick="window .open(this.href ,'','scrollbars =no, menubar=no, toolbar=no, resizable=yes, status=no, width=800, height=600'); return false;" target="_blank" ><asp:Image id="Image1" runat="server" CssClass="borde r_img" ImageUrl='<%# FormatURL(DataB inder.Eval(Cont ainer.DataItem, "prod_id")) %>' BorderStyle="So lid" BorderWidth="1p x">
[/CODE]
where FormatURL1 is server side functionComment
-
as acoder said already: javascript doesn't allow access to the local filesystem of the client ... and it should NOT! ... imagine a webpage that could access your filesystem ... nobody wants that. of course you could use some privileges or security settings in an environment where you could control such things (local machine or an intranet) ... but on a public site you cannot control the users settings ...
kind regardsComment
-
-
Originally posted by acoderYes, but have you read the page properly? It requires ActiveX, works in IE only, the security must be lowered, a security warning pops up, etc.
yes, i know that.
But using the same way is it possible to retrieve image files from the local system?Comment
-
is that a question? the answers are up there already. if you have an IE - and an IE not on a MAC - so: if you have an IE and windows and lower the security settings and use ActiveX - you may retrieve files from the local file system ... so the answer is yes. but as you see ... this is really useless for a public webpage ... but it could make sense for a intranet-environment where you have control over all that things that are preliminaries for that 'solution' ...Comment
-
Originally posted by acoderOne thing that can be added is that IE6 will allow you to set the source of an image to a local file by default. IE7 wouldn't by default and neither would other browsers.
seems to work in firefox:
Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head><title>local image test</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type='text/css'></style></head><body > image url:<input type='text' id='url' value='' /> <input type='button' id='' value='load it' onclick="loadit()" /> <br /> <br /><hr /> <img src="hello.jpg" id="img" alt="" border="0" /> <hr /> <script type='text/javascript'> function el(tid) {return document.getElementById(tid);} function loadit(){ el("img").src=el("url").value; } </script></body></html>
Comment
Comment