Thanks for the responses, but I should have said that this technique works under our current production environment, and I would expect this to be the case anyway particularly if you are attempting to use Search Engine Safe URL's ala Fusebox style (domain.co.uk/index.cfm/urlvariablename/urlvariablevalue.
My problem is I'm setting up a new server and this is one of those lovely little bugs that should be simple as anything to fix, but has taken me most of the day so far.
Paul - I'm already doing what you are saying and CFContent etc is already in the actual page, but we found that a large number of users had a problem where the download file appears as index.cfm so their browser didn't know to open this in Excel. The fix as mentioned at the time I think on this list, was to put the false filename.xls after index.cfm, to assist the users machine in. I'm going to give the index.cfm?filename=/filename.xls suggestion a go and see if that gets around it.
cheers
paddy
----------------------------
Paddy McKay
Technical Manager, Scotland
Scottish Property Network Limited
T: +44 (0)141 561 7300
F: +44 (0)141 561 7319
www.scottishproperty.co.uk
| Paul Johnston <[EMAIL PROTECTED]>
12/07/2004 15:19
|
To: [EMAIL PROTECTED] cc: Subject: Re: [ cf-dev ] IIS Config Problem |
Paddy,
IIS is a pain! it's annoying as hell, and whoever thought that it
should be produced as a production web server was quite possibly
woefully inadequate in the brains department. To set up to server
something as you've said, you need some form of URL rewriter to get it
working every time. check the archives for URL rewrite and you'll get
some help on this. Setting up IIS to work properly is just annoying,
but it can be done, BUT it depends on the setup and security policies
etc. Best bet is to *not* setup IIS in some wierd custom config, but to
just ensure that it gets the right file.
btw what you put wouldn't work as you'd expect. Webservers like IIS
will look for either the last filename or the ? character to determine
where the URL path ends. In other words, instead of:
index.cfm/filename.xls
put
index.cfm?filename=/filename.xls
you *may* have more success
You can get it working like this. It's almost pointless trying to fool
the client into "thinking" that it's getting a spreadsheet. Just tell
it that it's getting one and be done with it. What the client does after
that is up to the client.
To "tell" the client they are getting a certain type of file, just use
<cfcontent type="... whatever the app type is .."> and it doesn't
matter what the filename extension is. The only useful thing for that is
that for saving a file, you don't want them saving "content.cfm" but
"filename.xls". To do that is more complicated, but serving an excel
file is easy.
btw if you want to do it even better, create an html table and serve
that as an excel spreadsheet. Excel imports it perfectly (inc
background-colours and stuff).
tbh it's silly trying to catch all scenarios with this. Just put the
right content type in and spoof the name (as you've done) and that's
about all you can do (read: need to do).
Paul
Mark Smyth wrote:
> Hi Paddy
>
> I'm a bit surprised thats working, even on the dev machine.
>
> Why don't you
> 1. get the data you need
> 2. use cffile to create a Excel (or CSV) file
> 3. then use cfcontent to serve the file automatically to browser
>
> I think this will give you a more stable application. I just get the
> feeling you'll keep running into problems trying to get it working the
> way you are the moment and it might not even be IIS causing the problem.
>
> If you are determined to get it working the way you have on your
> development machine, you could always try adding .xls to IIS's
> application mappings (in the application configuration section) of
> your website, setting the excutable path to jrun.dll, but that is
> just an idea. Although it might work, I personally wouldn't recommend it.
>
> hth
> Mark
>
> -----Original Message-----
> *From:* [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> *Sent:* 12 July 2004 12:57
> *To:* [EMAIL PROTECTED]
> *Subject:* [ cf-dev ] IIS Config Problem
>
>
> Hi ,
>
> I've got a page that downloads results to Excel, but in order to
> work around some client issues to persuade their machines that
> they were getting a spreadsheet, I used a dummy file name on the
> end of the URL, i.e. index.cfm/filename.xls.
>
> This works fine on my development machine, but is not running on
> the new server I am currently setting up. IIS is not picking up
> that I am calling index.cfm and hence it trying to call
> filename.xls instead of passing the request to CF.
>
> I can't remember how this was resolved previously. Anyone got any
> pointers?
>
> TIA
>
> paddy
>
> ----------------------------
> Paddy McKay
> Technical Manager, Scotland
> Scottish Property Network Limited
>
> T: +44 (0)141 561 7300
> F: +44 (0)141 561 7319
>
> www.scottishproperty.co.uk
>
>This email is from Scottish Property Network Limited.
>The E-mail and any files transmitted with it are
>confidential and intended solely for the use of the
>individual or entity to whom they are addressed.
>
>Any unauthorised dissemination or copying of this
>e-mail, and any use or disclosure of any attachments
>contained in it, is strictly prohibited and may be
>illegal. If you have received the E-mail in error
>please notify us on [EMAIL PROTECTED] or telephone
>0141 5617300. Any views expressed by an individual
>within this E-mail do not necessarily reflect the
>views of the firm.
>
>Our general contact details are;
>Scottish Property Network Limited
>26 New Street
>Paisley
>PA1 1YB
>
>Telephone 0141 561 7300
>Fax 0141 561 7319
>
>
--
These lists are syncronised with the CFDeveloper forum at http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by activepdf.com*
*Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
*Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*
To unsubscribe, e-mail: [EMAIL PROTECTED]
This email is from Scottish Property Network Limited. The E-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorised dissemination or copying of this e-mail, and any use or disclosure of any attachments contained in it, is strictly prohibited and may be illegal. If you have received the E-mail in error please notify us on [EMAIL PROTECTED] or telephone 0141 5617300. Any views expressed by an individual within this E-mail do not necessarily reflect the views of the firm. Our general contact details are; Scottish Property Network Limited 26 New Street Paisley PA1 1YB Telephone 0141 561 7300 Fax 0141 561 7319 |
