Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

RESPONSE.DownloadFile

$
0
0
RESPONSE.DownloadFile
Web Connection 5.0
RESPONSE.DownloadFile
May. 8, 2013
10:41 am
3S30MWRF3Show this entire thread in new window
Gratar Image based on email address
From:David Pedrelli
To:All
Hi,

I have two WC 5 apps running on Windows 7. I am running them both inside of VFP, with pass-through authentication. The Windows user is an administrator. Both apps are running under the same IIS Web site. They are two different virtual directories, each with its own script map.

In one of them, I used RESPONSE.DownloadFile to download a file that is not accessible through the public Web site. It works fine. I copied the Web page and the .prg to the second app. The only thing that I changed is the extension of the Web page to match the script map. I am attempting the download the exact same file, from the same directory, running under the same user. It works fine in the first app. The second app gives me the following error:

Unable to download file

We were unable to send the requested file to the client.
'd:\pdfs\20130422\1\test2.pdf' is not a valid virtual path.

--------------------------------------------------------------------------------

Message generated by Web Connection IIS Connector Module


Here is the code that is in my Web page. THIS.oEntry is an instance variable for a wwBusiness object, which is instantiated in a parent wwWebPage class. Again, this same code works in the other app and the file is not accessible from the public Web site for either app.

FUNCTION OnLoad()
DODEFAULT()
IF NOT EMPTY(THIS.cID) THEN
THIS.DowloadRequestFile()
ENDIF
ENDFUNC

FUNCTION DowloadRequestFile()
sSQL = "SELECT * FROM roi.tbl_REQUEST_FILES WHERE FK_REQUEST = "
sSQL = sSQL + SESSION.GetSessionVar(THIS.cSessionVarRequestID)
sSQL = sSQL + " AND ID = " + THIS.cID
IF THIS.oEntry.Query(sSQL, "TDownload") = 1 THEN
RESPONSE.DownloadFile(TDownload.FilePath + TDownload.Filename)
ENDIF
ENDFUNC


Viewing all articles
Browse latest Browse all 10393

Trending Articles