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.
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI 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()); } ); } });