+ Post New Thread
Results 1 to 15 of 15
Home Access Plus+ Thread, Illegal characters in path message during file upload in Projects:; Hi, Using HAP+ 8.6. When using MyFiles, users can browse all paths successfully. If, however, a user tries to upload ...
  1. #1

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11

    Illegal characters in path message during file upload

    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.RaisePostBackEven t(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
    Last edited by mobybrick; 10th January 2013 at 08:22 PM.

  2. #2

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    Anyone? This appears to be a reproduceable problem.

    Ta
    Moby

  3. #3
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    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)?
    Last edited by nickbro; 12th January 2013 at 12:34 AM.

  4. #4
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    Ok, I think I've found the issue will be fixed in the next release, hopefully later today.

  5. #5

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    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.RaisePostBackEven t(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

  6. #6
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    Can you try the attached dll and report if it fixes it

  7. #7

    mac_shinobi's Avatar
    Join Date
    Aug 2005
    Posts
    9,785
    Thank Post
    3,292
    Thanked 1,054 Times in 975 Posts
    Rep Power
    365
    @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

  8. #8

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    Don't believe the local path is anything to do with it - the local path is C:\

  9. #9

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    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.RaisePostBackEven t(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

  10. #10
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    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

  11. #11

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    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.

  12. #12
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    Doh, I'd added it to the load function but not the upload button function

    the script is

    Code:
    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

  13. #13

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    Hi Nick,

    I'll try this tomorrow as soon as I get a chance

    Thanks,
    Moby

  14. #14
    nickbro's Avatar
    Join Date
    Jul 2010
    Location
    Gilwern, Wales
    Posts
    3,542
    Thank Post
    38
    Thanked 505 Times in 436 Posts
    Rep Power
    114
    thanks let me know, it should work as it's the same code as the html5 upload script

  15. #15

    Join Date
    Sep 2009
    Posts
    133
    Thank Post
    0
    Thanked 4 Times in 4 Posts
    Rep Power
    11
    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

SHARE:
+ Post New Thread

Similar Threads

  1. HAP File Upload from iPad (possibly in wrong forum)
    By peterdwyer in forum Home Access Plus+
    Replies: 2
    Last Post: 11th April 2013, 02:21 PM
  2. File Upload "Custom Files" in upload dialog
    By IT-Tom in forum Home Access Plus+
    Replies: 5
    Last Post: 9th January 2013, 02:34 PM
  3. Chinese characters in Office 2003?
    By zag in forum Windows
    Replies: 15
    Last Post: 1st October 2008, 09:09 AM
  4. Replies: 5
    Last Post: 28th May 2008, 10:37 PM
  5. Attachments in private messages
    By Elky in forum Comments and Suggestions
    Replies: 0
    Last Post: 15th March 2007, 10:20 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •