473,382 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Retrieve image files from local system

65
How can i retrieve image files from a local system's My pictures folder and display those images?
May 9 '08 #1
10 6271
acoder
16,027 Expert Mod 8TB
JavaScript doesn't allow access to the local file system, so this isn't really possible by just setting the src of images to the local filepath.

What you can do is use an input file element and upload the file to the server and then display it.
May 9 '08 #2
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..

Expand|Select|Wrap|Line Numbers
  1. <A href='<%#FormatURL1(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="border_img" ImageUrl='<%# FormatURL(DataBinder.Eval(Container.DataItem,"prod_id")) %>' BorderStyle="Solid" BorderWidth="1px">
  2.  
where FormatURL1 is server side function
May 10 '08 #3
gits
5,390 Expert Mod 4TB
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 regards
May 10 '08 #4
veenna
65
Please check this link


http://4umi.com/web/javascript/fileread.php#read
Jun 7 '08 #5
acoder
16,027 Expert Mod 8TB
Yes, 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.
Jun 7 '08 #6
veenna
65
Yes, 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?
Jun 7 '08 #7
gits
5,390 Expert Mod 4TB
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' ...
Jun 7 '08 #8
acoder
16,027 Expert Mod 8TB
One 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.
Jun 7 '08 #9
rnd me
427 Expert 256MB
One 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:
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head><title>local image test</title>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <style type='text/css'></style></head><body >
  6.  
  7. image url:<input type='text'  id='url' value=''  />    &nbsp;<input type='button'  id='' value='load it' onclick="loadit()" />    <br />
  8.  
  9. <br /><hr />
  10.  
  11. <img src="hello.jpg"  id="img" alt="" border="0"    />    
  12.  
  13. <hr />
  14.  
  15. <script type='text/javascript'>
  16.  
  17. function el(tid) {return document.getElementById(tid);}
  18.     function loadit(){
  19.         el("img").src=el("url").value;    
  20. }
  21.  
  22.  
  23. </script></body></html>
Jun 8 '08 #10
acoder
16,027 Expert Mod 8TB
Either you're testing locally, or you've changed the default settings. It doesn't work for me. You may have security.checkloaduri set to false if it's working non-locally.
Jun 8 '08 #11

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kabin selvam | last post by:
Hi, my scenario is like this, I have my document (word.or excel or pdf) stored a s a binary value(image datatype) in database, I need it to convert back into thedocument and save it as the file...
2
by: news.microsoft.com | last post by:
Hi, I am pretty new to ASP.net I want to do the following but I have been unable to find good info/ or sample code on it; please help; - retrieve a gif/jpeg image using ASP.net from another...
1
by: Manish Songar via .NET 247 | last post by:
(Type your message here) I am using asp.net. I am not storing image in sql server.I storeall the image in one folder. I want to access image from thatfolder to my client machine. Images folder...
35
by: Stan Sainte-Rose | last post by:
Hi, What is the better way to save image into a database ? Just save the path into a field or save the image itself ? I have 20 000 images (~ 10/12 Ko per image ) to save. Stan
24
by: TC | last post by:
Hi folks I want to enhance my website to distinguish "external" hyperlinks from "internal" ones. With that aim, I've written the following two small files for testing purposes: ...
7
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g....
4
by: meseenu | last post by:
Hi every one, iam developing an application where i want to upload image and video files in to a oracle data base. I have used BLOB data type to store the image and video files. iam using...
0
parshupooja
by: parshupooja | last post by:
Contact Reply 1 point Member propoo Joined on 08-31-2007, 10:32 PM Posts 3 Hey all ,
2
by: =?Utf-8?B?SmVmZlAtPg==?= | last post by:
I want to retrieve an image file (TIF) convert it to a bmp file and enable sizing. I know how to do the converting & sizing part, and store any atributes to file location in the webconfig, what...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.