Closed
Bug 291146
Opened 20 years ago
Closed 20 years ago
inconsistency between form file value AND document.getElementById ?
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: jphincelin, Unassigned)
Details
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.3) Gecko/20040910
I have the following problem in Mozilla 1.7.3 and Firefox 1.0 on a Windows 2000
PC with a form containing an input type=file for the user wanting to display an
image from its own discs :
The user chooses a file, then a
document.getElementById('myPhoto').innerHTML="<img
src='"+document.foto.file.value+"'>" does NOT display the photo.
To have it displayed, I must transform the value by inserting file:///C:/ etc
The problem does not exist in IE 6.
setup : Images are of course allowed
Any help ? Thanks
Reproducible: Always
Expected Results:
the image should display without any regexp javascriptAssignee: bugs → general
Component: Form Manager → DOM: HTML
Product: Firefox → Core
QA Contact: form-manager → ian
Version: unspecified → 1.7 Branch
Comment 1•20 years ago
|
||
The value is a file path. The src of an image is a URI. On Windows, the two use different path component separators. So you will in fact have to do some search-and-replace on the filepath to get a valid URI out of it... If "you" is an extension, you can create a URI object from the file path directly and get its spec, of course.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•