SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

i have list called SharesList has image column, so i need to make the end user upload image from his/her local pc... please i need any solutions immediately.

        var siteUrl = '/deanships/6thgraduation';
        var uploadedURL, itemTitle;
        function updateListItem(itemTitle,uploadedURL) {
            var clientContext = new SP.ClientContext(siteUrl);
            var oList = clientContext.get_web().get_lists().getByTitle('SharesList');
            var itemCreateInfo = new SP.ListItemCreationInformation();
            this.oListItem = oList.addItem(itemCreateInfo);
            oListItem.set_item('Title', itemTitle);
            oListItem.set_item('test', uploadedURL);

            clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));

        function onQuerySucceeded() {
            alert('Item updated!');

        function onQueryFailed(sender, args) {
            alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());

share|improve this question

Try this jQuery Add-in :

We recently worked on a similar solution. In our case we already had a REST WCF service so it was easier to add a new API with 1 single 'Stream' parameter and then use the above add-in, which basically creates an iframe with multipart form and then posts the data to a WCF Service. The service receives the data in stream and it needs to be decoded as stated here :

Hope this helps, Jomit

share|improve this answer

Have you tried this instead?

I haven't really seen ECMAScript examples uploading files in SharePoint. Either use a Silverlight Control or one of the Web Services to handle content. Client Object Model comes in many shapes (Managed, ECMA and Silverlight - each with its own constraints and limitations).

Hope it helps, C:\Marius

share|improve this answer
Thanks for your answer i will check it but i think it's helpful, but can i add item from picture library to list by javascript or JQuery ? – user1115156 May 14 '12 at 20:22
If you would manage to wrap it around the call for the Web Service, yes you can. See here for an example – Marius Constantinescu - MVP May 14 '12 at 23:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.