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
NeedHelp55NeedHelp55 

Attach Multiple File at Once using Apex. Is it possible? Please Help.

Hi,
I need to upload mutiple attachment at once by selecting them all. Is it possible in salesforce?
Vidhyasagaran MuralidharanVidhyasagaran Muralidharan
Check this whether this could be helpful
https://developer.salesforce.com/forums/?id=906F0000000AbocIAC
NeedHelp55NeedHelp55
Hi,Thanks for your reply but actually i was look for attaching multiple file at once.
Anyway i am able to select multiple item but cofused how to save them using javascript.

<apex:page controller="uploadAttachment" id="pageId">
   
        
    <script>
        function handleFileSelect(evt) {
            alert('{!acc.Id}');
            var temp = evt.target.files; // FileList object

            var output = [];
           
            for (var i = 0, f; f = temp[i]; i++) {
                output.push('<li><strong>', f.name, '</strong></li>');
            }
            document.getElementById('list').innerHTML = '<ul>' + output.join('') + '</ul>';
        }

        window.onload = function onBodyLoad() {
            document.getElementById('files').addEventListener('change', handleFileSelect, false);
        }
    </script>
   
    <apex:form id="formId">
    <input type="file" id="files" name="files[]" multiple="true" />
    <output id="list"></output>
  

   
        <!--<apex:repeat value="{!attachmentList}" var="iterate">
            <br/><apex:outputText value="{!iterate.Name}" styleClass="test"/><br/><br/>
        </apex:repeat>-->
    </apex:form>
 
</apex:page>

Any idea on this. Please.
Thanks.