I had a request today to create a link to a “Drop Folder” in SharePoint where people could drag their documents to for our Document Reviewers to review.

MSDN describes a solution (see “MSDN – About Web Folder Behaviors“) that is meant to work in browsers IE5 and later, but unfortunately it didn’t work in my employer’s *gasp* IE6 browser.

Using IE8’s Developer Tools, I hunted down how SharePoint was implementing the “Open with Windows Explorer” functionality.

Open with Windows Explorer

Open with Windows Explorer

On inspection, I found the element contained the following:

1
2
3
4
5
6
7
8
9
10
11
<tr menuGroupId="200" 
    description="Drag and drop files into this library." 
    text="Open with Windows Explorer" 
    onMenuClick="NavigateHttpFolder('http:\u002f\u002fsharepoint2007:100\u002fCSC Resumes', '_blank');"
    type="option"
    hidden="!(SupportsNavigateHttpFolder())"
    enabled="true"
    checked="false"
    onMenuClick_Original="NavigateHttpFolder('http:\u002f\u002fsharepoint2007:100\u002fCSC Resumes', '_bank');"
    text_Original="Open with Windows Explorer"
    description_Original="Drag and drop files into this library.">

Of particular interest is line 4:

 onMenuClick="NavigateHttpFolder('http:\u002f\u002fmoss_servername\u002fDocuments', '_blank');"

The NavigateHttpFolder function resides in the core.js file in the \12\TEMPLATE\LAYOUTS\1033 folder (assuming 1033 is your language code). The function takes two parameters:

  • urlSrc, the hex encoded url of the folder you wish to open
  • frameTarget, the target frame you wish to open the link in should the borwser be non-compliant with the functionality

Taking this into consideration and using the Content Editor Web Part to display the link, I wrote the following source code to achieve the functionality:

1
2
3
4
<a onclick="NavigateHttpFolder('http:\u002f\u002fmoss_servername\u002fDocuments',  'blank');" 
   href="#">
     Please place your items in this folder...
</a>

The precondition is that the above link will only work on pages where the master page has loaded the core.js file.

Hope this helps someone!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • Technorati
  • Twitter
  • MySpace
  • RSS
  • Twitthis

Tags: , ,

Open WebDAV folder from link, SharePoint 2007 : Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">