ISoapAttachment::Save Method

HRESULT Save([in] BSTR fileName);

Saves an in memory attachment to disk, and then free's the memory for the memory attachment. So, it converts an in memory attachment into a on disk attachment. If the specified file already exists, it will be overwritten.



BSTR, [in]: The fileName where to save the attachment to. If the file already exists, it will be overwritten.


Return Values

Throws an error if the attachment isn't an in memory attachment.


Sample Code

' parse the results
e.parse a

' find the response attachment
set theAttachment = a.response.find(e.parameters.item(0).href)
' if the attachment was small enough to stay in memory, force it to be saved to disk
if theAttachment.Located == attInMemory then
	theAttachment.Save "c:\xmlbus.gif"
end if
msgbox "the attachment is saved to " & theAttachment.Body


See Also

The ISoapAttachment Interface | 




Copyright © Simon Fell, 2000-2004. All rights reserved.