Click to See Complete Forum and Search --> : ASP and ActiveX/COM


anjalish
August 27th, 2000, 03:11 AM
hi,
I have to pass a file(binary file....which the user selects) on the server to an ActiveX/COM control.This file then needs to be loaded to a memory on a target hardware board connected to the parallel port on the client's machine.This loading of the file to the target board can be done using C++ and customised APIs for the board.
My problem is to pass a file which the user(client) selects to an ActiveX or com that will call a dll to do the programming of the hardware memory.
Can anybody help me please!.

soar
August 28th, 2000, 02:51 PM
All you need is a physical path to the file:

strPathInfo = Request.ServerVariables("PATH_INFO")
strPhysicalPath = Server.MapPath(strPathInfo)



Then use the FileSystemObject to get the file:

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.GetFile(strPhysicalPath)

Set objFolder = objFile.ParentFolder
Set objFolderContents = objFolder.Files

For Each objFileItem in objFolderContents
If objFileItem.Name = WhatTheUserSelected then
'Process
'Now, you can open, read, and re-write the file as you please.
End If
Next