DOWNLOADING A RESOURCE
from ALM via QTP:
workbookname = The name of your resource (not the file name)
savepath = the local location you want to save the resource to.
Dim QCResourceManager, ResourceFilter, ResourceList
Set QCResourceManager = QCUtil.QCConnection.QCResourceFactory
Set ResourceFilter = QCResourceManager.Filter
ResourceFilter.Filter("RSC_NAME") = workbookname
ResourceFilter.Filter("RSC_TYPE") = """Test Resource"""
Set ResourceList = ResourceFilter.NewList()
If ResourceList.Count <> 1 Then
Reporter.ReportEvent micFail, "Unable to locate resource: " & workbookname
Set latestfile = ResourceList.Item(1)
latestfile.DownloadResource savepath, True
UPLOADING A RESOURCE:
I haven't uploaded a file, but according to the API docs there is an UploadResource(resourcePath, synchronize) method, with the following notes:
The client path from which to upload the resource. If the path is an empty string, the resource is uploaded from the client cache.
If True, the operation is synchronous.
Set QCResource.FileName before uploading or downloading a resource.