Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

Javascript to upload a file to SharePoint 2010 document library

$
0
0

Please share your ideas. I am using SharePoint 2010. Currently when uploading files to a document library, first the upload form is opening to upload the document and then the edit form. I would like to have both this in the same form. I am trying to create a webpart page with the controls to upload the file to document library and assign values to the fields in the library. I am looking for some javascript for doing this. Is there any other way of achieving this? Please share any sample code.

<label for="title">Enter the title for this document:</label> <input type="text" id="title"><br/><br/>
<input id="inputFile" type="file"/><br/><br/>
<input id="uploadDocumentButton" onclick="UploadDocument()" type="button" value="Upload Document"/><script type="text/javascript">

        function UploadDocument() {
            //javascript to upload the file to MyLibrary and update the title field
        }

</script>


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>