-
Loy Chan
21
posts
Member since:
Mar 2008
Posted 14 Dec 2010
Link to this post
I'm using a Custom File Content Provider (copied from the knowledge base).
Everything works fine except the following situations:
1. Folder name contains # or & (i.e. "Store #123")
2. User double clicks file within this folder to view the file
3. Within the FileSystemHandler.ashx file, the ProcessRequest function is called but the path of the file gets cut off at the # or & symbol
So when the code gets to the WriteFile call, it fails since it can't find the file.
Suggestions?
Loy
-
-
Mihir Pathak
14
posts
Member since:
Aug 2009
Posted 15 Dec 2010
Link to this post
try to encode the path. In JavaScript you can use the encodeURI() function
-
-
Loy Chan
21
posts
Member since:
Mar 2008
Posted 15 Dec 2010
Link to this post
Hi,
Could you please provide a little bit more info? The FileExplorer is a bit of a black box for me.
When the user tries to open the file, I can catch this client side event with OnClientFileOpen event but where can I encode the path that eventually gets sent to the FileSystemHandler.ashx ProcessRequest method?
-
-
Mihir Pathak
14
posts
Member since:
Aug 2009
-
-
Loy Chan
21
posts
Member since:
Mar 2008
Posted 15 Dec 2010
Link to this post
Hi Mihir,
Thanks for all your help. I was able to get it running with your direction.
Here's what I had to use:
function ClientFileOpen(oExplorer, args)
{
var item = args.get_item();
if (!item.isDirectory())
{
args.set_cancel(true); //this prevents the window from opening
var docLoc = encodeURIComponent(item.get_path());
document.location = "FileSystemHandler.ashx?path=" + docLoc;
}
}
-