Access and Assign methods are a FoxPro feature. Take a look in the FoxPro help file.
The Assign method is fired automatically when a value is assigned to it. So if you assign the value is set based on the accept header. Now when you read the value it'll reflect the proper value based on the accept header.
Was the gzip code completed? I see code to compress it, but nothing that checks to see if the client sent an "Accept-Encoding:gzip" header.
I mention this because setting GZipCompression = .T. as the default in the response class worked great with a browser, but not so good with a dotNet app that didn't send accept gzip headers.
This is the gzip code I hit with response.write that gzipped it:
IFTHIS.GZipCompression AND LEN(THIS.cOutput) >= GZIP_MIN_COMPRESSION_SIZEthis.AppendHeader("Content-Encoding","gzip")this.cOutput = GzipCompressString(THIS.cOutput)ENDIF
Maybe I'm missing something. I also had lAllowGzip = .T. enabled as default in the wwHttp class.
From the documentation for 5.35 (GZipCompression):
If set to .T. automatically encodes the Response output to GZip compressed format. When set Web Connection automatically checks whether the client supports GZip compression and only compresses content if it does.
I don't see this function being called anywhere, but might do what the documentation suggests:
GZipCompression = .F. FUNCTION GzipCompression_Assign(llValue)IF llValueIFVARTYPE(Request) = "O"IFATC("gzip",Request.GetExtraHeader("HTTP_ACCEPT_ENCODING")) > 0
llValue = .T.ELSE
llValue = .F.ENDIFELSE
llValue = .F.ENDIFENDIFthis.GZipCompression = llValueENDFUNC
Thanks Rick.
Thanks Rick,
Fixed on this end.
For clarification of the problem:
The missing backslash causes a local filename to be created, which works fine as long as the application has rights to write into the current folder. However, with User Account Control enabled access to the local folder (in program files or whereever) is typically not allowed so it will fail.
Fixing the backslash as suggested by Rick writes the file where it's intended to be written which is the temp path which does allow writing of files in non-admin mode.
Thanks Rick,
+++ Rick ---