Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Problems: uploading files have Chinese named files

Reply
Thread Tools

Problems: uploading files have Chinese named files

 
 
Andrew Chan
Guest
Posts: n/a
 
      04-16-2004
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\yourw ebapp\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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Uploading multiple files whose INPUT field have the same name Moskie ASP .Net 0 08-04-2006 06:23 PM
ftp uploading vs. control panel uploading Dung Ping HTML 10 01-16-2006 10:43 AM
Q. Im using Agent yet since I came back home Tojyo, some headders have funky Chinese characters. Scratch Computer Support 2 05-13-2005 02:12 AM
anybody have experience in url decode (included chinese gb2312 character) ? Alont Perl Misc 0 08-27-2004 04:39 AM
Re: How do I translate a Chinese web site and add Chinese character set to IE..? =A0 - =A0 Taking these two questions one at a time... =A Patrick Dunford NZ Computing 3 04-28-2004 07:15 PM



Advertisments