Solved

Internet Explorer handling percentage encoded path

Posted on 2013-11-08
4
449 Views
Last Modified: 2014-01-03
I have written a SSRS report to return some results. The reason for the report is to find a specific file in a network share, and then be able to open the file via the network share.

One of the columns returns a hyperlinked Advanced Query Syntax query build up from the available data to make the AQS query results as specific as possible. The idea is to click on the hyper link and this would open a Windows Explorer window with "as specific" results as possible given the constructed query and utilize the windows search functionality.

The result of the AQS query look something like this:

search:query=filename_yyyymmdd_hhmm*.pdf&crumb=location:%5C%5Csharename%5Csubfolder%5Csubfolder%5C

Unfortunately the date/time section of the file name in the database table is slightly different (a few seconds either way) than the actual file name in the network share, hence search is used rather than the absolute path.

I successfully used the AQS query to find files in Windows Explorer and accessed the SSRS report via Firefox which exhibited the desired result, i.e. click the hyper link which opens a new Windows Explorer window (with the location specified from the AQS query) and the search text box populated with the search criteria from the AQS query.

Enter Internet Explorer … :(

It seems that once the hyper link is clicked Internet Explorer gets the AQS query "as is" but “corrects” the percentage encoded location sections (i.e. %5C%5C to \\ and %20 to ‘ ‘) and this “breaks” the AQS query since the location isn’t specified as it is with a windows share (i.e. “\\servername\share\file name” ) but rather with percentage encoded backslash and space values (i.e. %5C%5Cservername5%Cshare%5Cfile%20name).

When the hyper link is clicked the behaviour is as follows:

Internet Explorer - First box

 Internet Explorer - Second boxInternet Explorer - Final box
 

Is there any way to let internet explorer behave like firefox in this regard, i.e. open a Windows Explorer window and use the hyperlink “as is” and not “correct” the query?

Is there a better way to get the same end result?

Many thanks in advance.
0
Comment
Question by:Eric
  • 3
4 Comments
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39635292
In the link instead of using the href attribute, use some JavaScript via the onclick event.

E.g.

<a href="#" onclick="window.location='search:query=filename_yyyymmdd_hhmm*.pdf&crumb=location:%5C%5Csharename%5Csubfolder%5Csubfolder%5C'"> link to share</"a>
0
 
LVL 42

Expert Comment

by:Rob Jurd, EE MVE
ID: 39635380
Demo of it here: http://jsbin.com/ObAtUNu/2  does that exhibit the issue with the first link and not the second
0
 
LVL 42

Accepted Solution

by:
Rob Jurd, EE MVE earned 500 total points
ID: 39636075
failing that (i can't test it like you), you still retain the javascript but use the escape function to urlencode it again:

http://jsbin.com/ObAtUNu/2/

  <a href="search:query=filename_yyyymmdd_hhmm*.pdf&crumb=location:%5C%5Csharename%5Csubfolder%5Csubfolder%5C'"> link to share (href)</a>
  <br/>
  <a href="#" onclick="window.location='search:query=filename_yyyymmdd_hhmm*.pdf&crumb=location:%5C%5Csharename%5Csubfolder%5Csubfolder%5C'"> link to share (onclick)</a>
    <br>
  <a href="#" onclick="window.location='search:query=filename_yyyymmdd_hhmm*.pdf&crumb=location:'+escape('%5C%5Csharename%5Csubfolder%5Csubfolder%5C');"> link to share (onclick with escape)</a>

Open in new window

0
 

Author Closing Comment

by:Eric
ID: 39753623
Thanks for your help Rob, a lot of good information, much appreciated.
0

Featured Post

Why spend so long doing email signature updates?

Do you spend loads of your time carrying out email signature updates? Not very interesting are they? Don’t let signature updates get you down. Let Exclaimer Cloud - Signatures for Office 365 make managing email signatures a breeze.

Join & Write a Comment

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now