PDA

Click to See Complete Forum and Search --> : Help with ASP/dll


nickclarkson
Feb 2nd, 2001, 10:54 AM
Hi,

I've written a small dll to enable me to upload and download to/form an intranet site via ASP pages. While I was testing this it appeared to work fine on my Win98/PWS, but when I got someone else to connect to it and test it, all it saved the file locally on my laptop, not his, yet it is supposed to download to the user's local drive. I have another browse for folder dll, but that fires up the dialog box on my laptop when i connect from another pc.

I am new to this and was quite pleased when I got the thing to work at all, so any help would be appreciated.

Thanks,

Nick

msdnexpert
Feb 3rd, 2001, 11:02 PM
You must have hardcoded the destination path for the downloaded files to that of your laptop.

nickclarkson
Feb 4th, 2001, 03:55 AM
Both the URL of the remote file and the local file name are variables, and is called like this from my ASP page;

FileMgr.DownloadFile "http://xxx.xxx.xxx/documents/test.doc", "c:\my documents\test.doc"

but with variables replacing the actual strings.

What it does is "download" the file to that location on the server, not the users local drive. I am very new to ActiveX and I don't consider myself a programmer at all, so I am probably missing something obvious.

Thanks anyway,

Nick

msdnexpert
Feb 4th, 2001, 07:27 AM
Can you elaborate on the FileMgr object. Is it the FilesystemObject or some third party component.

nickclarkson
Feb 5th, 2001, 03:15 AM
Hi,

It's neither - it's just a single function from urlmon.dll

Private Declare Function URLDownloadToFile Lib "urlmon" Alias _
"URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, _
ByVal szFileName As String, _
ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

I compiled it and it does what I wanted it to do, ie downloads the file and skips the dialog boxes, but when i try it from anywhere but the server, it still saves to the servers local drive and not the users local drive. I'm probably doing something stupid, like not checking the "Create ActiveX object on client" or something like that - and I know that doesn't exist. Or I think ;)

Nick