David Rose | 8 Oct 23:06

4DISAPI, IIS, serving documents

In a 4D 2003 client/server application running on Windows 2003 Server, there 
is some web functionality built on an IIS -> 4DISAPI -> 4D Server 
configuration. Up until now, all web pages have displayed dynamically 
generated data from the database. Now we want to serve some existing Word, 
Excel, and PDF documents, but want to do so after doing some checks in 4D, 
so, as before, a user request for a document will be passed from IIS to 
4DISAPI to 4D Server. I am using the .4dp approach, i.e. in IIS, the .4dp 
extension has been added to the Application Mappings list, so that all 
requests for pages whose names end in .4dp will be passed along to 4D 
Server. The problem with applying this method when serving existing 
documents is that if the user wants to save the requested document to disk, 
and he right-clicks on a link whose URL is, for example:

https://www.mysite.com/4DCGI\WordDocument1.doc.4dp?sid=12345 etc.

...the user's browser will, when displaying a file saving dialog box, enter 
the file name as it appears in the URL:

 "WordDocument1.doc.4dp"

...and if the user doesn't modify the extension of the file name, the 
document will not open when the user subsequently double-clicks on it on his 
desktop.

Is there a way to solve this problem without adding each extension (.doc, 
.pdf, .xls, etc.) to the Application Mappings list in IIS?

David Rose

* Senior Software Engineer
(Continue reading)

Walt Nellson | 9 Oct 08:23

Re: 4DISAPI, IIS, serving documents

David,

This may not be what you want to hear, but I would suggest that you change your approach so that something else
besides the file extension is the indicator for what action to take in response to a web request..

For example, I use the "4DCGI" approach; that is, the characters that appear in the URL immediately
following "4DCGI" cause my code to branch off. For example, "4DCGI/Customer/xxxxxxx" will call a method
that calls methods that display or modify Customer data. "4DCGI/Inventory/xxxxxxx" will call a method
that calls methods that display and modify Inventory data, and so on.

Generally speaking, I have found that this system, along with cookies, is a simple but effective way to
route web requests.

HTH,

Walt
Sent from my BlackBerry® wireless device

-----Original Message-----
From: "David Rose" <drose108 <at> gmail.com>

Date: Wed, 8 Oct 2008 16:06:12 
To: <4d_tech <at> lists.4d.com>
Subject: 4DISAPI, IIS, serving documents


In a 4D 2003 client/server application running on Windows 2003 Server, there 
is some web functionality built on an IIS -> 4DISAPI -> 4D Server 
configuration. Up until now, all web pages have displayed dynamically 
generated data from the database. Now we want to serve some existing Word, 
(Continue reading)


Gmane