This method can get around the 16 meg limitation of Visual FoxPro strings for request output in COM mode. TransmitFile is much more efficient at sending large files as it avoids loading both FoxPro and the ISAPI DLL with these large strings, but instead causes wc.dll to read output directly from file back to the client.
You can send files directly:
FUNCTION TransmitFile Response.TransmitFile("d:\sailbig.jpg","image/jpeg") RETURN
Or you can generate output dynamically using a separate Response object that writes to file (or any other mechanism that writes a file for that matter) like wwResponseFile.
FUNCTION HugeOutput LOCAL lcOutputFile, loResponse lcOutputFile = Server.oConfig.oWwDemo.cHtmlPagePath + ; "temp\" + SYS(2015) + ".htm" *** Create a separate response object loResponse = CREATEOBJECT("wwResponseFile",lcOutputFile) FOR x=1 TO 1000000 loResponse.Write("012345678901234567890" + "<br>") ENDFOR *** Release and close loResponse = .null. Response.TransmitFile(lcOutputFile,"text/html") *** Some housekeepingDeleteFiles(JustPath( lcOutputFile ) + "\_*.*",900) && timeout in 15 minutes ENDFUNC
o.TransmitFile(lcFilename,lvHeader)
lvHeader
This method makes it much more feasible to build a file management by authorization scheme like paid access management, as it removes almost completely the load from the Web Connection server instances and only has ISAPI streaming the data back which is very efficient.
Make sure to NOT delete the file you are sending. If you need to delete the files after sending look into using wwUtils::DeleteFiles which allows you to do delayed cleanup.