[Zope] External Method file generation Vs MSIE

2005-04-28 Thread calisp
Hi All,

I have an external method that generates files - zip, pdf and xls.  I
would like the browser to present a file open/save dialog box and,
depending on what the user clicks, open or save the file.  Also, I
want to be able to set the file name.  Sounds simple enough and with
most browsers setting the Content-type appropriately and the
Content-Disposition to attachment; filename=whatever' works.  I
have not been able to get Internet Explorer to work properly though. 
Has anyone got this working?  If so, how?

Here is a full run down of the problem...

I believe Internet Explorer uses a combination of the following to
decide what to do with a file:

  o  The Content-Type header.
  o  The Content-Disposition header's value.
  o  The Content-Disposition header's filename attribute's extension.
  o  The extension of the external method.
  o  The first part (200 bytes?) of the file contents.
  o  The phase of the moon.  (well, perhaps not, but it's starting to
feel like it.)

It then does one of the following:

  o  Displays the file inline in the browser.
  
  o  Displays the file open/save dialog.  Clicking the save button
saves the file.
  Clicking the open button launches the application that is
associated with the
  file type IE has assumed the file to be but that application
gives a file not found
  error.

  o  Displays the file open/save dialog.  Clicking on open or save
displays another
  file open/save dialog.  Clicking the save button again saves the file.  
  Clicking the open button again launches the application that is
associated with
  the file type IE has assumed the file to be but that application
gives a file not
  found error.

The filename of the file saved or the suggested filename when saving a
file being viewed inline is sometimes the filename attribute in the
content-disposition header and sometimes
external_method?query=string.ext.

I have tried various combinations of the following:

  o  Setting the Content-Type header to the file type, application/octet-stream,
  application/x-force-download, etc

  o  Not setting the Content-Type header.

  o  Setting the Content-Disposition header to inline, attachment and download
  with and without a filename attribute.

  o  Not setting the Content-Disposition header.

  o  Naming the external method filename.ext where ext is zip, pdf or xls as 
  appropriate.

  o  Hard coding the settings in the external method and not using a
query string.

Despite all this I have completely failed to get MSIE to behave in a
sane manner and would greatly appreciate any advice anyone has on the
matter.

With thanks,


Calisp
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Forcing all Zope access to come through an Apache/SSL proxy

2005-04-28 Thread calisp
On 28/04/05, Reuven M. Lerner [EMAIL PROTECTED] wrote:
[...]
 The above should make it possible (I believe), an HTTPS connection
 between my browser and my cup.  Apache should then take that incoming
 SSL request and issue its own request to the Zope server.  Zope will
 respond, sending it back to Apache, which (in turn) sends it back to me.
 
 But of course, that doesn't happen.   Zope's provides indicates that
 many of the requests begin with \x80g\x01\x03.
[...]

The following works for me... 

-
VirtualHost [ip_address]:443

ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log

SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP
SSLCertificateFile /etc/httpd/ssl/[domain].crt
SSLCertificateKeyFile /etc/httpd/ssl/[domain].key

SetEnvIf User-Agent .*MSIE.* \
 nokeepalive ssl-unclean-shutdown \
 downgrade-1.0 force-response-1.0

CustomLog logs/ssl_request_log \
  %t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \%r\ %b

ServerName [domain]
RewriteEngine On
ProxyVia On
RewriteRule ^/(.*)
http://localhost:8080/VirtualHostBase/https/[domain]:443/folder/VirtualHostRoot/$1
[L,P]

Location /manage
Order Deny,Allow
Deny from All
/Location

/VirtualHost
-

HTH,

Calisp
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Cached Variables

2005-06-23 Thread calisp
Hi,

I am developing an application that is a front end to an RDBMS. 
Sometimes, when loading a page, several scripts get called that all
require the same information from the database.  It would obviously be
costly for each script to call the same ZSQL method.  My method for
avioiding this senario is...

Get the scripts to call another script that is a wrapper to the ZSQL
method.  This wrapper script returns context.REQUEST[value_name] if it
exists or, if it does not exist, executes the ZSQL method, stuffs the
result into REQUEST[value_name] and then returns it.

I am not convinced that this is the right way of dealing with this
situation however.  Is there a better way?

Thanks,

Calisp
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Cached Variables

2005-06-23 Thread calisp
On 23/06/05, Andrew Milton [EMAIL PROTECTED] wrote:
 +---[ [EMAIL PROTECTED] ]--
 | Hi,
 |
 | I am developing an application that is a front end to an RDBMS.
 | Sometimes, when loading a page, several scripts get called that all
 | require the same information from the database.  It would obviously be
 | costly for each script to call the same ZSQL method.  My method for
 | avioiding this senario is...
 
 ZSQL Methods can do their own caching... you can set it from the Advanced Tab
 of the ZSQL Method. This should eliminate the overhead of multiple calls.

Ah, nice.  Setting it to a second should do the job in this case. 
Ideally I'd like it doing it on a per request basis though.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )