SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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

Hi all using jquery i want to upload file to solution gallery.

so is that possible to upload file in solution gallery using jquery.

how?

another thing is it possible to upload file in document library using jquery.

share|improve this question
up vote 0 down vote accepted

I found that copy file from one document library to other using jquery

         $(document).ready(function () {     

      function handleDropEvent(event, ui) {

             var draggable = $(ui.draggable);     

        var context = SP.ClientContext.get_current();   
          var web = context.get_web();   
          var lists = web.get_lists(); 
            var _destinationlib = lists.getByTitle("My Documents");   
          context.load(web);       
      context.load(_destinationlib);   

          var currentLib = lists.getByTitle("Excel Library");  
          var currentItem = currentLib.getItemById(44);             
          context.load(currentItem);   
           var File = currentItem.get_file();   
          context.load(File);        
context.executeQueryAsync(function (sender, args) {if (File != null) {var _destinationlibUrl = web.get_serverRelativeUrl() + _destinationlib.get_title() + '/' + File.get_name();                        
 File.copyTo(_destinationlibUrl,true);                                                   
context.executeQueryAsync(function (sender, args) {},function (sender, args) {SP.UI.Notify.addNotification('Error copying file', false);                                    SP.UI.Notify.removeNotification(notifyId);                                  showError(args.get_message());                              });                         }                   },                  function (sender, args) {                       alert('Error occured' + args.get_message());                    }                 );             }         });
share|improve this answer

Your Answer

 
discard

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.