Solved

Internet Explorer handling percentage encoded path

Posted on 2013-11-08
4
457 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 43

Expert Comment

by:Rob
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 43

Expert Comment

by:Rob
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 43

Accepted Solution

by:
Rob 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

Increase your protection from Zero Day threats!

Running two Antivirus' is never a good idea.
Taking advantage of Multiple Security layers on the other hand can often save your hide.
See which top notch security software brands have been proven to happily coexist together.
Reduce your chances of becoming a statistic.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Google currently has a new report that is in beta and coming soon to Webmaster Tool accounts. This Micro Tutorial will highlight new features for Google Webmaster Tools.

734 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