You need to sign in to do that
Don't have an account?

Pushing a file to sf
Im looking to attach a file to an account record.
The Attachment object talks about first converting the file to base64 binary.
Please point me in the right direction toward some examples of sending files to salesforce.com
Thankyou
-GL
Here is a function to convert a file to base64 in VB.NET. Ping me if you want the C# code.
Private Function getFileBase64String(ByVal objFileName As String) As String
Dim inFile As System.IO.FileStream
Dim binaryData() As Byte
Dim bytesRead As Long
Dim base64String As String = ""
inFile = New System.IO.FileStream(objFileName, System.IO.FileMode.Open, System.IO.FileAccess.Read)
ReDim binaryData(inFile.Length)
bytesRead = inFile.Read(binaryData, 0, inFile.Length)
inFile.Close()
base64String = System.Convert.ToBase64String(binaryData, 0, binaryData.Length)
Return base64String
End Function
Cheers;
GlennW
www.demandtools.com