System.ArgumentException: Illegal characters in path

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?SG9seXNtb2tl?=

    #1

    System.ArgumentException: Illegal characters in path

    Hi there,

    I am having a problem im my webservices method when trying to save a file
    with latin characters to disk passed through WSE.

    I have noticed that when trying to read the file name from all the latin
    characters are converted ? character which is a illegal character for file
    name.

    If my file name is N° documento per Romà

    Dim oFile As Microsoft.Web.S ervices2.Dime.D imeAttachment
    = CType(oAttach, Microsoft.Web.S ervices2.Dime.D imeAttachment)
    tmpFileName = oFile.Id

    tmpFileName contains the string with N? documento per Rom? which becomes the
    illegal file name and the code cannot save to disk.


    I have tried in web.config,
    <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
    fileEncoding="u tf-8"/>

    but don't work. Can someone shed some light on this?

    TIA,
    Holy
  • =?Utf-8?B?VG9jbw==?=

    #2
    RE: System.Argument Exception: Illegal characters in path

    Holy......for grins you might try testing your regional and language settings
    and see if that helps.

    "Holysmoke" wrote:
    Hi there,
    >
    I am having a problem im my webservices method when trying to save a file
    with latin characters to disk passed through WSE.
    >
    I have noticed that when trying to read the file name from all the latin
    characters are converted ? character which is a illegal character for file
    name.
    >
    If my file name is N° documento per Romà
    >
    Dim oFile As Microsoft.Web.S ervices2.Dime.D imeAttachment
    = CType(oAttach, Microsoft.Web.S ervices2.Dime.D imeAttachment)
    tmpFileName = oFile.Id
    >
    tmpFileName contains the string with N? documento per Rom? which becomes the
    illegal file name and the code cannot save to disk.
    >
    >
    I have tried in web.config,
    <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
    fileEncoding="u tf-8"/>
    >
    but don't work. Can someone shed some light on this?
    >
    TIA,
    Holy

    Comment

    • =?Utf-8?B?VG9jbw==?=

      #3
      RE: System.Argument Exception: Illegal characters in path

      Holy...probably the web service doesn't recognize the latin characters. This
      KB article can shed some light on the subject

      The information in this article applies to:


      Microsoft Internet Explorer (Programming) 5
      Microsoft Internet Explorer (Programming) 5.5
      Microsoft XML 3.0
      Microsoft XML 3.0 SP1
      Microsoft XML 4.0

      --------------------------------------------------------------------------------

      This article was previously published under Q238833
      SYMPTOMS
      When parsing XML that contains "special characters" using the Microsoft XML
      parser (MSXML), the parser may report the following error message at the line
      and position of the first special character:
      An Invalid character was found in text content.
      CAUSE
      The XML document is not marked with the proper character encoding scheme.
      RESOLUTION
      Specify the proper encoding scheme in the XML processing instruction.

      - or -

      Re-encode the XML data as proper UTF-8.
      STATUS
      This behavior is by design.
      MORE INFORMATION
      "Special character" refers to any character outside the standard ASCII
      character set range of 0x00 - 0x7F, such as Latin characters with accents,
      umlauts, or other diacritics. The default encoding scheme for XML documents
      is UTF-8, which encodes ASCII characters with a value of 0x80 or higher
      differently than other standard encoding schemes.

      Most often, you see this problem if you are working with data that uses the
      simple "iso-8859-1" encoding scheme. In this case, the quickest solution is
      usually the first listed prior in the RESOLUTION section. For example, use
      the following XML declaration:
      <?xml version="1.0" encoding="iso-8859-1" ?>
      <rootelement>
      ...XML data...
      </rootelement>

      Alternatively, you can encode each of those characters using the numeric
      entity reference. For example, you can take the special character á, use
      <test>á</test(decimal version) or <testá</test(hex version).

      Keywords: kbFAQ kbIntl kbIntlDev kbprb KB238833
      Technology: kbAudDeveloper kbIEsearch kbMSXML300 kbMSXML300Searc h
      kbMSXML300SP1 kbMSXML400 kbMSXML400Searc h kbMSXMLSearch kbSDKIE500 kbSDKIE550
      kbSDKIESearch kbZNotKeyword



      "Holysmoke" wrote:
      Hi there,
      >
      I am having a problem im my webservices method when trying to save a file
      with latin characters to disk passed through WSE.
      >
      I have noticed that when trying to read the file name from all the latin
      characters are converted ? character which is a illegal character for file
      name.
      >
      If my file name is N° documento per Romà
      >
      Dim oFile As Microsoft.Web.S ervices2.Dime.D imeAttachment
      = CType(oAttach, Microsoft.Web.S ervices2.Dime.D imeAttachment)
      tmpFileName = oFile.Id
      >
      tmpFileName contains the string with N? documento per Rom? which becomes the
      illegal file name and the code cannot save to disk.
      >
      >
      I have tried in web.config,
      <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
      fileEncoding="u tf-8"/>
      >
      but don't work. Can someone shed some light on this?
      >
      TIA,
      Holy

      Comment

      • =?Utf-8?B?SG9seXNtb2tl?=

        #4
        RE: System.Argument Exception: Illegal characters in path

        Hi Toco,

        Thanks for the reply. But I don't use any xml string at all in my web
        service. It simply web services with WSE enabled to pass DIME attachments. If
        I try to restore the file name from the following code

        Dim oFile As Microsoft.Web.S ervices2.Dime.D imeAttachment
        = CType(oAttach, Microsoft.Web.S ervices2.Dime.D imeAttachment)

        the caller passes the name of the file as 1st parameter from the
        dimeattachment constructor. It is a default data type string and I wonder it
        cannot accept latin character since string accepts all utf-8 characters.

        Is there anything still in web.config to be configured or is it a bug?

        TIA,
        Holy
        "Toco" wrote:
        Holy...probably the web service doesn't recognize the latin characters. This
        KB article can shed some light on the subject
        >
        The information in this article applies to:
        >
        >
        Microsoft Internet Explorer (Programming) 5
        Microsoft Internet Explorer (Programming) 5.5
        Microsoft XML 3.0
        Microsoft XML 3.0 SP1
        Microsoft XML 4.0
        >
        --------------------------------------------------------------------------------
        >
        This article was previously published under Q238833
        SYMPTOMS
        When parsing XML that contains "special characters" using the Microsoft XML
        parser (MSXML), the parser may report the following error message at the line
        and position of the first special character:
        An Invalid character was found in text content.
        CAUSE
        The XML document is not marked with the proper character encoding scheme.
        RESOLUTION
        Specify the proper encoding scheme in the XML processing instruction.
        >
        - or -
        >
        Re-encode the XML data as proper UTF-8.
        STATUS
        This behavior is by design.
        MORE INFORMATION
        "Special character" refers to any character outside the standard ASCII
        character set range of 0x00 - 0x7F, such as Latin characters with accents,
        umlauts, or other diacritics. The default encoding scheme for XML documents
        is UTF-8, which encodes ASCII characters with a value of 0x80 or higher
        differently than other standard encoding schemes.
        >
        Most often, you see this problem if you are working with data that uses the
        simple "iso-8859-1" encoding scheme. In this case, the quickest solution is
        usually the first listed prior in the RESOLUTION section. For example, use
        the following XML declaration:
        <?xml version="1.0" encoding="iso-8859-1" ?>
        <rootelement>
        ...XML data...
        </rootelement>
        >
        Alternatively, you can encode each of those characters using the numeric
        entity reference. For example, you can take the special character á, use
        <test>á</test(decimal version) or <testá</test(hex version).
        >
        Keywords: kbFAQ kbIntl kbIntlDev kbprb KB238833
        Technology: kbAudDeveloper kbIEsearch kbMSXML300 kbMSXML300Searc h
        kbMSXML300SP1 kbMSXML400 kbMSXML400Searc h kbMSXMLSearch kbSDKIE500 kbSDKIE550
        kbSDKIESearch kbZNotKeyword
        >
        >
        >
        "Holysmoke" wrote:
        >
        Hi there,

        I am having a problem im my webservices method when trying to save a file
        with latin characters to disk passed through WSE.

        I have noticed that when trying to read the file name from all the latin
        characters are converted ? character which is a illegal character for file
        name.

        If my file name is N° documento per Romà

        Dim oFile As Microsoft.Web.S ervices2.Dime.D imeAttachment
        = CType(oAttach, Microsoft.Web.S ervices2.Dime.D imeAttachment)
        tmpFileName = oFile.Id

        tmpFileName contains the string with N? documento per Rom? which becomes the
        illegal file name and the code cannot save to disk.


        I have tried in web.config,
        <globalizatio n requestEncoding ="utf-8" responseEncodin g="utf-8"
        fileEncoding="u tf-8"/>

        but don't work. Can someone shed some light on this?

        TIA,
        Holy

        Comment

        Working...