Date:  06/27/2006 08:10:22 PM Msg ID:  003003
From:  FoxWeb Support Thread:  002997
Subject:  Re: download.fwx cause \"OLE exception error\"
Does the script fail for ANY doc file, or a few specific files?  It's interesting that you are including your code in a VFP executable.  We have not tested this configuration and, although it's probably OK, we can't support it.
 
Also, I have two questions/comments:
 
Is there a reason why you are using Website instead of Microsoft Personal Web Server (PWS)?  PWS is basically the same as IIS, but it's renamed for the non-server version of Windows 2000.  IIS is extremely reliable and supports ISAPI, which will give you a significant performance gain.  You can install PWS from the Control Panel -- Add and Remove Programs -- Add/Remove Windows Components.  You should re-install FoxWeb 3.3 once you install PWS, so that it will configure PWS as necessary.
 
It seems like you are allowing the inclusion of full paths in your URLs (c:\webroot\...).  Not only is this bad because it tells hackers about the location of your code on your server, but it also allows them to run code in any VFP program on your server.  It is an extremely dangerous practice, which was discontinued many years ago. 
 

FoxWeb Support Team
support@foxweb.com email

Sent by fs chern on 06/26/2006 11:14:54 PM:
Dear sir:
This error happen when I download a ms-word files(MS word 2002,*.DOC).
It will be ok when I download a text file.(*.TXT).
Your are right,I am using the CGI executable, foxweb.exe.
My program's source code list as follow.I compile it to a execute file websrv.exe,
and test it in IE where URL is writing as follow:
http://locahost/cgi-bin/foxweb.exe/downfile1@c:/webroot/websrv.exe?action=showinbrowser
 
Thanx!
f.s. chern
===============================================
*websrv.prg
procedure DOWNFILE1
 M.FILENAME="D:\DATA\webhelp.DOC"
 ErrMsg = ""
 Response.Buffer = .T.
 FileExtension = UPPER(JustExt(FileName))
 IF FILE(FileName) AND INLIST(FileExtension, "GIF", "JPG", "JPEG", "DOC", "PDF")
  IF Request.Form("action") = "download"
   ContentType = "application/unknown"
   Response.AddHeader("Content-Disposition", "attachment; filename=" + FileName)
  ELSE
   DO CASE
   CASE FileExtension == "GIF"
    ContentType = "image/gif"
   CASE INLIST(FileExtension, "JPG", "JPEG")
    ContentType = "image/jpeg"
   CASE INLIST(FileExtension, "DOC")
    ContentType = "application/msword"
   CASE INLIST(FileExtension, "PDF")
    ContentType = "application/pdf"
   ENDCASE
   Response.AddHeader("Content-Disposition", "inline; filename=" + FileName)
  ENDIF
  FileContent = ReadFile(FileName)
  Response.AddHeader("Content-Length", Server.ToString(LEN(FileContent)))
  Response.ContentType = ContentType
  Response.Write(FileContent)
  Response.End
 ELSE
  ErrMsg = "Selected file does not exist, or is not of an authorized file type."
 ENDIF
RETURN .T.
 
 
Sent by FoxWeb Support on 06/26/2006 09:52:47 PM:
Does this happen with all file downloads, or specific files?  Is it related to file size, or a specific type of file?  You are using Website as your web server, so I assume that you are using the CGI executable, foxweb.exe, right?

FoxWeb Support Team
support@foxweb.com email

Sent by fs chern on 06/25/2006 08:39:03 AM:
I get the following error in fwstart.log when I test the download.fwx:
 
Error: 1440 Message: "OLE exception error: Exception code c0000005. OLE object may be corrupt" Program: "WWW_READ.FXP" Line Number: 59 Channel: 1
 
I get the same error message when I test by FW2.5,FW 2.6 or FW3.3. What OLE object is it?
 
OS:window 2000 professional
WEB server:website 3.0
 
thanx!!
 
f.s. chern