What do you exactly mean. I really couldn't understand the problem well. I could not make assumption too :)
vishesh
Nearly a Posting Virtuoso
1,381 posts since Oct 2006
Reputation Points: 85
Solved Threads: 42
All browsers come with a built in XML parser which can be used to load XML files which can then be accessed using DOM. Read this for reading local XML files.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733
Whether or not a browser allows a page to reference files on a user's computer in any way is dependant on the browser and perhaps security settings; although, it's certainly been possible in previous IE versions to display images that are stored on a user's PC via a webpage, regardless of the host of the webpage. For that user only of course...
This works for me in IE6:
<html>
<head>
</head>
<body>
<img src="file://c:/synd.gif"/>
</body>
</html>
But not in Opera or Firefox.. Dunno about IE7. Opera and Firefox only allow this when the host is the localhost - in other words; when the page referencing the image is also on the user's PC.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64
Accessing resources on the users computer doesn't mandate the use of absolute pathing. We can still use relative paths and at the same time access the images on the users computer provided the hierarchy / folder structure is well defined and considering the path / folder where our HTML resides as the root.
~s.o.s~
Failure as a human
11,938 posts since Jun 2006
Reputation Points: 3,281
Solved Threads: 733
If the entire site/page is offline, yes... I'm not 100% sure on the OPs requirements, but 'web page' implies a page on the web; and if the page really is hosted on the web ( i.e. on a host that cannot be assumed to be the localhost ); then the obvious way to access anything on a given user's machine from that webpage is using an absolute path starting with 'file://' as per that example ( and to my knowledge this only works with < IE6[7??], and only with images ).. If the site/page that requests the image is also on the localhost, then no problem, it will work in any browser: use relative, absolute, or root-relative paths, whatever you prefer.
But I don't think that's the case, read the posts, the OP specifically says 'i cant access those files on server side if i say it will search on server.' Forcing the browser to use the file:// protocol instead http:// protocol in theory will allow the browser to access files on the user's own filesystem; in practice it wont work reliably - not all browsers will allow it in all circumstances - because it's dangerous. BUT it will always work, if the page and the image are sourced from the same host... e.g. if the .html file is saved on the same computer as the .gif/.jpg/etc files.
MattEvans
Veteran Poster
1,386 posts since Jul 2006
Reputation Points: 522
Solved Threads: 64