So my client got a little too fancy about having a way to upload documents from anywhere on “a site”, to a particular document library available within that site.
Referring to the SharePoint way of uploading documents as below, I was made to run for a solution that would allow them to add this functionality to any web part page.
This wasn’t that bad of a thought. Well, at the end it got out to be quite straight forward, if you are happy and comfortable with java-script.
This is what was done, to allow them quickly add a script in a content editor and display a huge button like this:
Now the code:
<div class="ms-uploadbtnlink">
<button onclick="javascript:OpenNewFormUrl('Documents/Forms/upload.aspx');return false;" type="submit">
<nobr>
<img alt="Upload Document" src="/_layouts/Images/uploaddoc.png"/> <span>Upload Document</span>
</nobr>
</button>
</div>
Thanks for reading!