This question already has an answer here:
I have been searching for a way to upload a document manually to a SharePoint document library using Jquery. i have done it in C#, but i want to do the same in Jquery. Still i couldn't find the way, but i am trying. Please anyone would help me to get this stuff done. Any guide is appreciated.
Basic logic what i did in C# is shown below, how would i do the same thing in Jquery. I am using SharePoint 2010 and my browser is IE9
string filename = fileBrowser.FileName; Stream fstream = fileBrowser.FileContent; SPFile spfile = myLibrary.Files.Add(filename, fstream, replaceExistingFiles);