mobybrick Posted January 10, 2013 Posted January 10, 2013 (edited) Hi, Using HAP+ 8.6. When using MyFiles, users can browse all paths successfully. If, however, a user tries to upload to a remote path that contains an ampersand in the remote pathname (e.g. "Art & Design") then the upload fails with the message below. Downloads are not affected - it appears to be upload operations only. Thanks, Moby. Server Error in '/hap' Application. -------------------------------------------------------------------------------- Illegal characters in path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Illegal characters in path. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentException: Illegal characters in path.] System.IO.Path.CheckInvalidPathChars(String path) +142 System.IO.Path.Combine(String path1, String path2) +38 HAP.Web.UploadH.uploadbtn_Click(Object sender, EventArgs e) in n:\Visual Studio 2010\Projects\CHS Extranet\HAP.Web\UploadH.aspx.cs:108 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 Edited January 10, 2013 by mobybrick
mobybrick Posted January 11, 2013 Author Posted January 11, 2013 Anyone? This appears to be a reproduceable problem. Ta Moby
nickbro Posted January 12, 2013 Posted January 12, 2013 (edited) Sorry wrong post. I will investigate a fix for this. Which upload agent are you using? HTML5 or the old HTML uploader (1 upload box or 5)? Edited January 12, 2013 by nickbro
nickbro Posted January 12, 2013 Posted January 12, 2013 Ok, I think I've found the issue will be fixed in the next release, hopefully later today.
mobybrick Posted January 14, 2013 Author Posted January 14, 2013 Hi Nick, Sorry to report, but this is still happening. IE9, so HTML uploader. With the 8.7 code. Note how the apersand is replaced to |26 in the browser bar. The upload path was ../testhap/myfiles/#G\2012-2013\DEPARTMENTS - FACULTIES\DESIGN FACULTY\Design |26 Technology\Food\New folder Server Error in '/testhap' Application. -------------------------------------------------------------------------------- Illegal characters in path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Illegal characters in path. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentException: Illegal characters in path.] System.IO.Path.CheckInvalidPathChars(String path) +142 System.IO.Path.Combine(String path1, String path2) +38 HAP.Web.UploadH.uploadbtn_Click(Object sender, EventArgs e) +934 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
nickbro Posted January 14, 2013 Posted January 14, 2013 Can you try the attached dll and report if it fixes it
mac_shinobi Posted January 14, 2013 Posted January 14, 2013 @nickbro - appologies in advance if this is of no relevance or help at all, if it is not then can a mod please delete this comment if required On the "Security" tab in the "Internet Properties" control panel there is a button to customise the security level for whichever zone is selected there. Clicking that gives you another dialogue box with a list of options. Roughly halfway down that list there is an option for "Include local directory path when uploading files to a server". If that's disabled for the relevant zone (whatever zone IE says it's using when you're using your app), try enabling it. Just wondering if this helps at all ( obviously depends on version of IE ) Think this setting is for IE 8, not sure if this setting exists in IE 9 or other versions of IE Just a shot in the dark / thought that may or may not help
mobybrick Posted January 14, 2013 Author Posted January 14, 2013 Don't believe the local path is anything to do with it - the local path is C:\
mobybrick Posted January 15, 2013 Author Posted January 15, 2013 Hi Nick, Tried the DLL - thanks - but no joy: Server Error in '/testhap' Application. -------------------------------------------------------------------------------- Illegal characters in path. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.ArgumentException: Illegal characters in path. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [ArgumentException: Illegal characters in path.] System.IO.Path.CheckInvalidPathChars(String path) +142 System.IO.Path.Combine(String path1, String path2) +38 HAP.Web.UploadH.uploadbtn_Click(Object sender, EventArgs e) +934 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +154 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3707 -------------------------------------------------------------------------------- Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
nickbro Posted January 15, 2013 Posted January 15, 2013 Ok, I'll have to have another look when I get home tonight, see if I can get some more information outputted when you go on that page
mobybrick Posted January 15, 2013 Author Posted January 15, 2013 Hi Nick, I've never been able to build HAP at home, but if I build a quick test app then any call to Path.Combine will cause an exception if " |26 " is in the string. Why |26 is/may be in the string I don't know apart from the fact it obviously takes the place of the ampersand. The line string path = Server.UrlDecode(Request.QueryString["path"].Remove(0, 1).Replace('^', '&')); could be replaced by string path = Server.UrlDecode(Request.QueryString["path"].Remove(0, 1).Replace('^', '&').Replace("|26", "&&"); but I don't know what other problems that might introduce. Nor why one should have to fudge around it anyway! Anyway, it case it helps.... thanks for looking at this... Regards Moby.
nickbro Posted January 15, 2013 Posted January 15, 2013 Doh, I'd added it to the load function but not the upload button function the script is string path = Server.UrlDecode(Request.QueryString["path"].Remove(0, 1).Replace('^', '&').Replace("|", "%")); Can you try this one next, otherwise I'll have to go back to the drawing board and see what else I've missed
mobybrick Posted January 15, 2013 Author Posted January 15, 2013 Hi Nick, I'll try this tomorrow as soon as I get a chance Thanks, Moby
nickbro Posted January 15, 2013 Posted January 15, 2013 thanks let me know, it should work as it's the same code as the html5 upload script
mobybrick Posted January 17, 2013 Author Posted January 17, 2013 Hi Nick, Sorry for the delay in responding - couldn't try anything yesterday due to a project. The last web.dll fix does indeed correct the problem with the upload issue. Thanks again! Moby
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now