Jump to content

Recommended Posts

Posted (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 by mobybrick
Posted (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 by nickbro
Posted

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

Posted

@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 :)

Posted

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

Posted

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.

Posted

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

Posted

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...