Add an attachments field and submit button


Posted by MES5464 - Oct 21 ’13 at 05:14

I found the following code that if pasted into an HTML control it will provide an file selection field for the user to select a file to attach to a list item, and an OK button that will then attach the file to the list item. It seems to work great.


<div height="15" id="attachmentsOnClient" style="float:left;">

<span dir="ltr">

<input type="file" name="fileupload0" id="onetidIOFile" size="56" title="Name" />




<input id="attachOKbutton" type="BUTTON" onclick='OkAttach()' value="Upload" style="width: 12.8em; height: 3em"/>

<span id="idSpace"/>


  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 8 years 9 months 11 days
    #1 by Dmitry Kozlov Oct 22 ’13 at 02:48

    Thank you very much for the usefull information!

  • hp
    Member for: 7 years 7 months 21 days
    #2 by hp Jan 16 ’15 at 01:29

    How do i get attachment attached to list item? i have added html to my form, it display browse and upload buttons. it also fatched the file from system. My only question is what do i write on upload button to attach file to item. thanks in advance. and by the way this is awesome!

  • hp
    Member for: 7 years 7 months 21 days
    #3 by hp Jan 16 ’15 at 02:03

    This works now. smile and i will say again its great

Displaying 1 to 3 of 3 messages