You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Henrique Boregio <hb...@gmail.com> on 2011/01/15 20:14:28 UTC

Browser loading absolute image paths

Hi, I am trying to load a picture from a user folder, so I am storing
the picture's path and pasting it into the "src" attribute of the
image tag.

As an example, I have the picture named "profile.jpg" located at
"F:\workspace\project\pictures\2", so the corresponding HTML is:

<img wicket:id="image" src="F:\workspace\project\pictures\2\profile.jpg"/>

This picture exists and I can easily navigate to that folder using a
file browser, but it won't load from the browser.
How can I make the browser load absolute paths like this? Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Browser loading absolute image paths

Posted by Martijn Dashorst <ma...@gmail.com>.
This will never, ever, ever work. Image's src attribute tells the
browser where to look. Since your customers won't have
F:\workspace\project\pictures\2\profile.jpg (or possibly they might,
but that is a 0.0000001% chance), the browser will shows a 404 image
not found error in the best possible scenario, but probably will fail
because you can't refer to local resources from an external domain
without breaking the sandbox.

Martijn

On Sat, Jan 15, 2011 at 8:34 PM, Emmanouil Batsis <ma...@abiss.gr> wrote:
>
>
> Quoting Henrique Boregio <hb...@gmail.com>:
>>
>> <img wicket:id="image" src="F:\workspace\project\pictures\2\profile.jpg"/>
>
> That will never work. You *might* have a chance using the file: URI scheme
> like
>
> <img wicket:id="image"
> src="file:///F:/workspace/project/pictures/2/profile.jpg"/>
>
>
> but, overall, this may be a security thing that requires configuration on
> the browser side to work in any case.
>
> hth,
>
> Manos
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Become a Wicket expert, learn from the best: http://wicketinaction.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Browser loading absolute image paths

Posted by Emmanouil Batsis <ma...@abiss.gr>.

Quoting Henrique Boregio <hb...@gmail.com>:
> <img wicket:id="image" src="F:\workspace\project\pictures\2\profile.jpg"/>

That will never work. You *might* have a chance using the file: URI  
scheme like

<img wicket:id="image"  
src="file:///F:/workspace/project/pictures/2/profile.jpg"/>


but, overall, this may be a security thing that requires configuration  
on the browser side to work in any case.

hth,

Manos

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org