Problems: uploading files have Chinese named files

Discussion in 'ASP .Net Web Services' started by Andrew Chan, Apr 16, 2004.

  1. Andrew Chan

    Andrew Chan Guest

    Hi everyone,
    I try to upload file by using asp.net, code like that:
    <script language="VB" runat="server">

    Sub Upload(Source As Object, e As EventArgs)

    If Not (myFile.PostedFile Is Nothing) Then

    Dim intFileNameLength as Integer
    Dim strFileNamePath as String
    Dim strFileNameOnly as String

    'Logic to find the FileName (excluding the path)
    strFileNamePath = MyFile.PostedFile.FileName
    intFileNameLength = Instr(1, StrReverse(strFileNamePath), "\")
    strFileNameOnly = Mid(strFileNamePath,
    (Len(strFileNamePath)-intFileNameLength)+2)

    myFile.PostedFile.SaveAs("c:\inetpub\wwwroot\yourwebapp\upload\" &
    strFileNameOnly)
    lblMsg.Text = "File Upload Success."
    lblFileContentType.Text = "Content type: " &
    MyFile.PostedFile.ContentType
    lblFileSize.Text = "File size: " & CStr(MyFile.PostedFile.ContentLength)
    & " bytes"

    End If
    End Sub
    </script>

    It is OK with uploading english named file, but not in chinese named files.
    Any one can help me to solve this problem.

    Many Thanks,
    Andrew
     
    Andrew Chan, Apr 16, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vasil Buraliev

    problems with uploading mp3 files

    Vasil Buraliev, Nov 10, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    430
    Vasil Buraliev
    Nov 10, 2003
  2. Dung Ping
    Replies:
    10
    Views:
    992
    Chaddy2222
    Jan 16, 2006
  3. Moskie
    Replies:
    0
    Views:
    391
    Moskie
    Aug 4, 2006
  4. Alont
    Replies:
    0
    Views:
    127
    Alont
    Aug 27, 2004
  5. RTF
    Replies:
    1
    Views:
    72
Loading...

Share This Page