[whatwg] access to local path in input type="file"

2008-03-20 Thread ddailey
In the code which follows, both IE7, FF(2.0), and Safari(3.1) allow the user 
to change the src attribute of an image based on her perusal of local file 
space. Opera 9.5 doesn't seem to allow access to the path data necessary for 
accomplishing this rollover effect, and I suspect that may be how it is 
supposed to be according to emerging standards. That is the situation when 
the HTML file is stored on localhost.


If however, one places the code on a server (see 
http://granite.sru.edu/~ddailey/imageUpload.htm) then the program works from 
none of the browsers. apologies in advance if I made a mistake :(


While I understand the possible risk of exposing a path name of the local 
file system to script, the various use cases of allowing users to access 
local images within HTML, the  tag and within  all seem 
self-evident to me. Is there some standard workaround to allow the user to 
change the source of an image on a web page to one that is locally stored? I 
used to have a dozen mini-apps that took advantage of the ability to do this 
(they even used to work in Netscape 4 and IE 4), but the programs have all 
broken in the past few years in all contexts except IE -- (for example here 
http://granite.sru.edu/~ddailey/svg/clipembed.html where the input type=file 
script is remarkably simple).


What seems odd to me is that the browsers (except Opera) all seem to expose 
the path data to script, despite blocking the easy use of that data. Maybe 
I'm missing something obvious.


Apologies, also, if this issue has already been discussed -- my memory seems 
never to have been what it should have been.


regards,
David

-code



function change(I,s){
 alert(document.getElementById("y").value)
 pieces=I.src.split("/")
 pieces.pop()
 path=pieces.join("/")+"/"
 spieces=s.split(/[\/\\]/)
 file=spieces.pop()
 path=spieces.join("/")+"/"
 alert(path)
 f.Q.value="file://localhost/"+s
 I.src=f.Q.value
}


















[whatwg] Clarifications needed in "application cache selection algorithm" section

2008-03-20 Thread Anders Carlsson
"If there is already an application cache identified by this manifest  
URI, and that application cache contains a resource with the URI of  
the manifest, and that resource is categorised as a manifest, then:  
store the resource in the matching cache with the most up to date  
version, categorised as an implicit entry, associate the Document with  
that cache, invoke the application cache update process, and abort  
these steps."


as well as

"If there is already an application cache identified by this manifest  
URI, then that application cache does not yet contain a resource with  
the URI of the manifest, or it does but that resource is not yet  
categorised as a manifest: store the resource in that cache,  
categorised as an implicit entry (replacing the file's previous  
contents if it was already in the cache, but not removing any other  
categories it might have), and abort these steps."


need to clarify that the cache needs to be the most recently updated  
cache in the group.


Anders