function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Upload binary file as attachment in an scontrol

How do you upload a binary file (i.e. Word document or pdf file) on the user's desktop to salesforce as an attachment inside an scontrol?  Is base64 encoding even necessary? I tried this (encoding using a C# COM object method installed on the client) and it didn't work even though I know the same encoding algorithm works perfectly using the Office Toolkit when uploading the file as an attachment.  Here is the code in my scontrol that creates an attachment, but the content is now what I expected.  Can anyone please help?


Message Edited by gsickal on 05-11-2006 04:53 PM

Nevermind.  I fixed the problem by converting the bytestream of the file into char[] and NOT encoding with base64 in my COM code and everything worked fine.  Problem solved.
The solution to this problem (uploading an attachment through an scontrol) is to NOT encode the attachment body content using base64. The soap interface handles this for you so you do NOT need to do any encoding.

Message Edited by gsickal on 06-08-2006 08:22 AM

I am also trying to this. I am having a custom object in which with each record I need to put an image. So, I am using a s-control
for to attach image file. But I am struggling to this.
Can u plz help me on this? I mean how can we achieve this using s-control?
Plz reply soon if u can.