You need to sign in to do that
Don't have an account?
juventuss
Retrieve attachment sample in vb.net
Most samples have C++ documentation. Is there a sample code showing how to retrieve an attached document from a given parent Id. Specifically how to download and convert the body from base64.
thanks
thanks
Hi there, I also get the problem with downloading attachment in .NTET environment and seems no one is replied my posting before, I need this solution badly, is there any moderator or developer out there know how to do this?
sq
Dim stub As New sforce.SforceService
Dim lr As sforce.LoginResult
lr = stub.login("your_login", "your_password")
stub.SessionHeaderValue = New sforce.SessionHeader
stub.SessionHeaderValue.sessionId = lr.sessionId
stub.Url = lr.serverUrl
Dim att(1) As sforce.sObject
Dim id(1) As String
id(0) = "00P30000000kxHe"
att = stub.retrieve("Body, Name", "Attachment", id)
Dim data() As Byte
data = Convert.FromBase64String(att(0).Any(0).InnerText)
Dim fn As String
fn = "c:\dl_" + att(0).Any(1).InnerText
Dim f As New System.IO.FileStream(fn, IO.FileMode.CreateNew)
f.Write(data, 0, data.Length)
f.Close()
Console.WriteLine("Created Attachment " + fn)