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

Uploading attachments to case

Could somebody provide me with sample code on how to upload attachments to cases in asp or aspx?




Attachment a = new Attachment();

a.parentId = 'the id of the case';

a.filename = 'foo'; 

a.extension = '.bar';

a.body = fileContentsAsByteArray(someFile);

SaveResult sr = binding.create(new SObject [] {a})[0];

if (sr.success)


Thanks for the feedback Simon

Does anyone know how to do this with PHP?


Thanks so much!