yes, thanks, Paul, that's right. It's an interesting compromise. I had to
abandon the type=file in Jmol Protein Explorer for FireFox3 because of that.
If you can't get the actual path to the file, which I think is actually a
good security feature, you can't later reproduce the state, unless you want
to load the entire file as a DATA string. (Which may not be such a bad idea,
I guess.)



On 8/27/08, Paul Pillot <[EMAIL PROTECTED]> wrote:
>
> This one might also be regarded as off topic, but as some you might
> be stuck with the same problem, I thought it might be worth to share.
> The issue is that starting from firefox 3.0, when using an input file
> element in a form, you can't access to the full path of the file
> chosen by the user, even if it's fully displayed in the form. e.g. : /
> user/paul/3ert.pdb. From javascript, the file.value string would give
> you only the file name  (eg : 3ert.pdb).
> I didn't find any way of getting the full path back. However one can
> now access to the whole file content directly from javascript, using
> the getAsText method. Coupled with the jmolLoadInline function, it
> allows to load any local file into the Jmol applet. For example I
> successfully used the following code :
>
> <input type="file" id="loadname" size="20" onchange="jmolLoadInline
> (document.getElementById('loadname').files.item(0).getAsText(''));
> return false;">
>
> It worked smoothly with any plain text file. It didn't work with a
> gzipped file, giving back a "unrecognized file format for file
> string" error message.
>
> Paul
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>



-- 
Robert M. Hanson
Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to