Home › Forums › vLooup for SharePoint › Replace link used for "upload files"
- This topic has 5 replies, 2 voices, and was last updated 6 years, 10 months ago by Alexander Bautz.
-
AuthorPosts
-
-
November 15, 2017 at 22:18 #18764
Is there a way to replace the link used for “upload files” when using vLookup to add files to a document library? I find that using a link to a web part page with the folder associate with the task is much better and would like for that to be the link used instead of the default upload file screen.
What I did was create a web part page with a web part of the document library. I hid everything else on the page except for the section that shows the files and allows you to add new files. I have a folder manually created before files can be uploaded (I only allow files to be uploaded into a folder, not individually) for other processes. Because each task has one specific folder, I can tell the link for my web part page to open the correct folder where additions/removals can occur.
-
November 22, 2017 at 22:46 #18847
Hi,
You can override the upload function used when you hover over a folder and click the blue upload icon by adding this in the custom js:spjs.vLookup.uploadToFolder = function(fin,url){ var o = {"autoSize":true}; spjs.vLookup.data.refreshThisField = fin; url = "YOUR_CUSTOM_UPLOAD_URL"; SP.UI.ModalDialog.commonModalDialogOpen(url,o,spjs.vLookup.uploadCallback); };
Change “YOUR_CUSTOM_UPLOAD_URL” with your custom URL.
If it’s the “New document” button, you can override it like this:
jQuery("#newItemWrap_vLookupDocuments").html("<span onclick='spjs.vLookup.uploadToFolder(\"vLookupDocuments\",\"\");'>New document</span>");
Change “vLookupDocuments” with the name of your field.
Alexander
-
January 3, 2018 at 15:53 #19159
The first piece of code is excellent! Thank you!
I have a single line of text field called “DocLibraryFolderName” I would like to append to the end of the “YOUR_CUSTOM_UPLOAD_URL”, how would I code that?
-
January 3, 2018 at 19:16 #19161
Please disregard this question, I was able to figure out how to do what I needed. Thank you for all your help!
This is an excellent solution to use when using vLookup to a document library, it is much nicer than the standard document upload screen.
-
January 11, 2018 at 16:07 #19299
New question: Is there also a way to get the “Upload files” icon to always be visible? Right now it only shows when you mouse over the area to the right of the folder icon, but I want it to always be visible.
-
-
January 11, 2018 at 20:35 #19303
Add this to the Custom CSS in your DFFS config for that form:
.spjs_folder_btn{ display:inline!important; }
Alexander
-
-
AuthorPosts
- You must be logged in to reply to this topic.