Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
COM access on a WEB server
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00813519
Message ID:
00813533
Views:
8
You need to grant at least Read access to iusr_ and iwam_ (anonymous accounts)for the physical directories you're using. You could do this manually through Explorer or automate it like the following (from ActiveVFp PostSetup):
lcPath1=IIF(EMPTY(cFolder),THIS.cAppStartPath,cFolder+'\')+'data\'+cProd &&THIS.cappstartpath
lcPath2=IIF(EMPTY(cFolder),THIS.cAppStartPath,cFolder+'\')+'ErrorLog\'+cProd
lcPath3=IIF(EMPTY(cFolder),THIS.cAppStartPath,cFolder+'\')+cProd+'r\Temp'
lcPath4=IIF(EMPTY(cFolder),THIS.cAppStartPath,cFolder+'\')+cProd+'r\pdffiles'
	
LOCAL ARRAY laDataFiles[1]
LOCAL lnFileCount,lnI
lnFileCount=ADIR(laDataFiles,lcPath1+[\*.*])
	
START = this.long2str(68) + REPLICATE(CHR(0), 40)+this.long2str(1)+this.long2str(0)+REPLICATE(CHR(0), 16)

* do cacls.cmd for write access on data
	
IF ! EMPTY(lcCompName)
* create a temp batch file
*data dir
   STRTOFILE([cacls "]+lcPath1+[" /E /G IUSR_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath1+[" /E /G IWAM_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath1+[" /E /G IUSR_]+lcCompName+[:R] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath1+[" /E /G IWAM_]+lcCompName+[:R] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
*error log dir
   STRTOFILE([cacls "]+lcPath2+[" /E /G IUSR_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath2+[" /E /G IWAM_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
*app temp dir
   STRTOFILE([cacls "]+lcPath3+[" /E /G IUSR_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath3+[" /E /G IWAM_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
*general temp dir
   STRTOFILE([cacls "]+lcPath4+[" /E /G IUSR_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   STRTOFILE([cacls "]+lcPath4+[" /E /G IWAM_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
*individual data files
   FOR lnI = 1 TO lnFileCount
	STRTOFILE([cacls "]+lcPath1+[\]+laDataFiles(lnI,1)+[" /E /G IUSR_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
        STRTOFILE([cacls "]+lcPath1+[\]+laDataFiles(lnI,1)+[" /E /G IWAM_]+lcCompName+[:W] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
	STRTOFILE([cacls "]+lcPath1+[\]+laDataFiles(lnI,1)+[" /E /G IUSR_]+lcCompName+[:R] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
	STRTOFILE([cacls "]+lcPath1+[\]+laDataFiles(lnI,1)+[" /E /G IWAM_]+lcCompName+[:R] + CHR(13)+CHR(10),THIS.cAppStartPath+"temp.cmd",.T.)
   ENDFOR
RELEASE laDataFiles
* execute the batch file
File2Run = THIS.cAppStartPath+[temp.cmd] + CHR(0)
RetCode = CreateProcess(0, File2Run, 0, 0, 1, ;
			NORMAL_PRIORITY_CLASS, 0, 0, @START, @process_info)
* Unable to run, exit now.
IF RetCode = 0
  THIS.cError="Error occurred. Error code: "+ GetLastError()
  RETURN THIS.cError
ENDIF
>Hi All,
>
>We created(in VFP) and installed a couple of COM objects on a Web Server. The problem is that they work only when a person that registered them is logged in. Otherwise we are getting this message: "Internal Server Error".
>
>Any help will be appreciated,
>Galina
Previous
Reply
Map
View

Click here to load this message in the networking platform