Using local images...

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Using local images...

Post by alex.barylski »

Edit: I've already looked into IE security options for local intranet...couldn't find anything so please be specific. :)

I'm sure I've done this - mind you this was years ago (5+) so security may have changed since then... :(

I'm trying to use a local image in my web application:

Code: Select all

<img src="C:\Documents and Settings\Alex\Desktop\some-logo.gif" />
The web page is currently hosted on localhost...I figured for sure I would be sprung with that annoying warning IE throws at you...but instead it just doesn't work...I'm not given any warning...in FireFox or IE...

Anybody know if this is configurable somehow?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

file://
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

I was just going to say...I tried that...no luck :(

I've searched high and dry in both IE and FF options and there seems nothing I can do...sadly.

It made for a really cool image upload preview before uploading feature on an old web site I built in 2000ish...thankfully that site no longer exists as the upload preview functionality would be broken... :)

Any other ideas?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Do you PHP echo it?
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

Initially yes...

The I hardcoded the actual path:

Code: Select all

file://C:\Documents and Settings\Alex\Desktop\filelist.png
I tried reversing the slashes in the path and everything...nothing worked...not even when put inside an anchor...I"m guessing latest browsers IE6/7 and FF2+ simply don't want you to directly access files on local machines...smart move I suppose...

Have you had success accessing files on a remote machine from localhost?
User avatar
VladSun
DevNet Master
Posts: 4313
Joined: Wed Jun 27, 2007 9:44 am
Location: Sofia, Bulgaria

Post by VladSun »

Sorry, I thought you want to open local files from local machine...
I don't think you can achieve what you want.
There are 10 types of people in this world, those who understand binary and those who don't
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

Post by alex.barylski »

VladSun wrote:Sorry, I thought you want to open local files from local machine...
I don't think you can achieve what you want.
Hey it's good man... :D

Thanks anyways. :)
Post Reply