SPUG: HTTP Headers

El JoPe Magnifico jope-spug at jope.net
Tue Dec 11 12:48:42 CST 2001

In the past, I've tacked on the suggested filename as (or at the end of)
the PATH_INFO part of the URL, after the CGI script name, e.g.
Works on Apache, dunno about other servers.  Remember to URI-escape the
filename first, to account for whitespace, etc.

On Tue, 11 Dec 2001, Parr, Ryan wrote:
> I'm currently moving the intranet site I work on to be completely database
> based. However, I'm running into a snag with delivering documents to the
> user. Rather, delivering documents other than HTML to the user.
> If I have my CGI load a word doc that's stored in the database, and send it
> to the user with the appropriate mime type, the browser can handle it
> appropriately. Unfortunately though, I have no way to specify a filename for
> the content. So instead of receiving an Open/Save dialog for CMS_SOP.doc
> they receive an Open/Save dialog for /cgi-bin/loadpage.cgi?id=334, or the
> browser loads the word doc with the filename /cgi-bin/loadpage.cgi?id=334.
> I haven't been able to find any standard HTTP headers that deal with this
> scenario, nor any IE specific extension headers. I'm in a controlled
> environment so everyone has IE 4+. This approach to document delivery seems
> natural enough to me that I'm sure a thousand developers before me have
> attempted it, certainly some with success. Have any of you?

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://zipcon.net/spug/

More information about the spug-list mailing list