Geoff,

Provided you supply jsmol.php on your server and point to it using
Info.serverURL, everything works smoothly. Turning the binary into BASE64
is exactly what it does. Plus, it handles access to databases for MSIE.

Bob



On Fri, Jul 19, 2013 at 6:06 AM, Geoffrey Rowland
<rowland.ge...@gmail.com>wrote:

> Recently revisited this and realised the problem is the file access
> control of the particular CMS (e.g. Moodle or Mahara). This blocks access
> if the file loading is via jsmol.php (for binary files with IE or Chrome)
> rather than directloading. Obviously, there is no issue when jsmol.php is
> used with publicly accessible databases.
>
> Wondering if it is possible to more directly do the base64 conversion and
> loading into JSmol e.g. using, say. PHP file_get_contents(), followed by
> base64_encode(), then JSmol load inline "", or something similar.
>
> Any suggestions?
>
> Cheers
>
>
>
>
>
>
> On 2 June 2013 22:16, Geoffrey Rowland <rowland.ge...@gmail.com> wrote:
>
>> Actually, I think I'm hitting browser (IE and Chrome) permission issues
>> rather than problems with binary file handling per se.
>>
>> See e.g.
>> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Loading_the_library
>>
>> It's tricky to put files in locations which both meet the requirements of
>> the CMS (Mahara), JSmol and most/all Browsers.
>>
>> Have managed to get things working on a local webserver:
>> http://localhost... but not with (what I think is) much the same setup
>> on a remote webserver: http://whatever...
>>
>> Do IE and Chrome have different permissions with http://localhost and
>> remote webservers?
>>
>> I thought I had grasped the issues with local files and webserver hosted
>> files, but this seems to be another layer of complexity.
>>
>> Cheers
>>
>> Geoff
>>
>>
>> On 1 June 2013 12:02, Geoffrey Rowland <rowland.ge...@gmail.com> wrote:
>>
>>> Hi
>>>
>>> I have been tinkering with integrating JSmol with the open source
>>> CMS/ePortfolio system Mahara. https://mahara.org
>>>
>>> It's working nicely for text data files (.pdb, .mol, .sdf, .xyz, .cif
>>> etc) but I'm having problems with binary files, specifically PyMOL Session
>>> files .pse with Chrome and Internet Explorer 10. Firefox, Opera and Safari
>>> work fine.
>>>
>>> As I understand it, the problem is that Mahara stores files as a number,
>>> without file extension. However, as JSmol does not usually require file
>>> extensions to identify file types, they can still be successfully loaded
>>> into JSmol with, for example:
>>>
>>> load "http://localhost/mahara/artefact/file/download.php?file=38&view=8
>>> ";
>>>
>>> I can also get binary PyMOL session files to load and display with JSmol
>>> in Firefox, Opera or Safari by appending, say, &ext=.pse to the load
>>> command, i.e. 'fooling' these browsers that the filename includes .pse (see
>>> http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Reading_binary_files
>>> )
>>>
>>> However, this does not work for Chrome or Internet Explorer 10. Chrome
>>> just crashes, though with Firebug reports:
>>>
>>> Error reading file at end of file
>>> Type Error:Object [object Object] has no method 'addAll'
>>> for file
>>> http://localhost/mahara/artefact/file/download.php?file=38&view=8&ext=.pse
>>> type PyMOL
>>>
>>> Have tried a few other things, such as prepending the load with PSE:: to
>>> try to force binary handling, but without success.
>>>
>>> I think I am using jsmol.php correctly. All browsers works fine for the
>>> dna.pse exemplar at http://chemapps.stolaf.edu/jmol/jsmol/test2.htm,
>>> /test3.htm, /jsmol.htm etc either at stolaf.edu or copied to my
>>> localhost. So, I presume it just needs some way of forcing Chrome and IE to
>>> recognise the PSE files as binary, when held in Mahara.
>>>
>>> Any suggestions? Have I overlooked something simple?
>>>
>>> Cheers
>>>
>>> Geoff
>>>
>>>
>>>
>>> <http://wiki.jmol.org/index.php/Jmol_JavaScript_Object#Reading_binary_files>
>>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> Jmol-users mailing list
> Jmol-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jmol-users
>
>


-- 
Robert M. Hanson
Larson-Anderson 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
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Jmol-users mailing list
Jmol-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to