BUG Image setURL() doesn't work for local file URL in Firefox

153 views
Skip to first unread message

marsh...@gmail.com

unread,
Aug 31, 2006, 4:52:20 PM8/31/06
to Google Web Toolkit
If I call Image.setURL("file://C:/temp/my.gif");

it works in hosted browser, in web mode IE but not Firefox 1.5

also tried file:/ and file:///

dm

jac...@gmail.com

unread,
Sep 1, 2006, 9:52:37 AM9/1/06
to Google Web Toolkit

Why you use full path url? In my opinion you should change to reference
path.

Copy your source files into the same path with your .html code.

marsh...@gmail.com

unread,
Sep 5, 2006, 8:46:53 AM9/5/06
to Google Web Toolkit
You misunderstand. I'm not trying to reference a URL that lives on a
server.

Maybe some background will help.

I've got a FileUpload Widget that allows a user to select an image file
(from their local drives) and submit it. Prior to submission, I wish
to display the image so I've got an Image widget. I call its setURL
method to the path of the file the user is going to upload.

In Firefox, the image does not display.

Vivian Li

unread,
Sep 7, 2006, 3:07:07 AM9/7/06
to Google-We...@googlegroups.com

Hi Marshall62,
   Firefox will not allow this because of cross-site scripting vulnerabilities. It is a security error and if you check the JavaScript console you will find an error that looks something like:

Security Error: Content at http://yourdomain.com/foo.html may not load or link to file:///Users/john/Pictures/01-03-06_1250.jpg .

  If you just use regular HTML and no GWT, you will get the same error.

-Vivian
Reply all
Reply to author
Forward
0 new messages