Windows Vista Tips

Windows Vista Tips > Newsgroups > Internet Explorer > how to display a file name correctly when I click open attached fi

Reply
Thread Tools Display Modes

how to display a file name correctly when I click open attached fi

 
 
flyhammer
Guest
Posts: n/a

 
      01-20-2009
** test spec **
- ASP
- Based on UTF-8
- multilingual file download ( Especially Korean, Japanese, Chinanese etc. )
- IE 7.0

Hello~ Guy.

Now I'm just make to download multilingual files(UTF-8) using
Response.BinaryWrite.
Although (Fortunately) I can make a multilingual file download work, I'm
just faced up to an unexpected difficulty.

when I click "open button" to check attached multilingual file although the
filename is shown correctly on the filedownload dialog, Actually the file
name is shown as %EC%84%B8%EC%9D%BC%EB%9F%AC[1].doc on ms-word. ('Save as'
shows the correct name)

So, I look forward to finding the solution how to be accurately displayed
the filename when I click "open button" whihout saving.

If you know the mean I wish to know, plese give me some guide to solve this
problem.
Or, any recommnad is accepted any component or web browser to support the
function to be displayed filename correctly when I open the attached file.
(* Maybe I wonder how to solve this problem by any other Server-side
Language( JSP, ASP.NET etc )

as far as here, it's all my problem.
From now on, I just wait your opinion. thank you~.

Sample Code
================================
<%@ Language=VBScript%>
<%

old_codepage = Session.CodePage
Session.CodePage = "65001"

file = "세일러.doc" '%EC%84%B8%EC%9D%BC%EB%9F%AC[1].doc

encodename = Server.UrlEncode(file)
delimiter = InStrRev(encodename, "%2E")

if delimiter <> 0 then
tempname = Left ( encodename, delimiter - 1 )
temptype = Right ( encodename, Len(encodename) - delimiter - 2 )
encodename = replace( tempname & "." & temptype, "+" ,"%20" )
end if

Response.ContentType = "application/unknown"
Response.AddHeader "Content-Disposition","attachment; filename=" &
encodename

Set objStream = Server.CreateObject("ADODB.Stream")

objStream.Open
objStream.Type = 1
objStream.LoadFromFile Server.MapPath("./data/")&"\"& file

download = objStream.Read
Response.BinaryWrite download

Set objstream = nothing

%>

 
Reply With Quote
 
 
 
 
PA Bear [MS MVP]
Guest
Posts: n/a

 
      01-20-2009
See these MSDN pages: http://msdn2.microsoft.com/en-us/ie/default.aspx and
http://msdn.microsoft.com/en-us/library/ms537623.aspx and
http://msdn2.microsoft.com/en-us/ie/aa740476.aspx

You can also post here instead:

MSDN IE Development Forums
http://forums.microsoft.com/MSDN/def...D=253&SiteID=1
--
~Robear Dyer (PA Bear)
MS MVP-IE, Mail, Security, Windows Desktop Experience - since 2002
AumHa VSOP & Admin http://aumha.net
DTS-L http://dts-l.net/

flyhammer wrote:
> ** test spec **
> - ASP
> - Based on UTF-8
> - multilingual file download ( Especially Korean, Japanese, Chinanese
> etc. )
> - IE 7.0
>
> Hello~ Guy.
>
> Now I'm just make to download multilingual files(UTF-8) using
> Response.BinaryWrite.
> Although (Fortunately) I can make a multilingual file download work, I'm
> just faced up to an unexpected difficulty.
>
> when I click "open button" to check attached multilingual file although
> the
> filename is shown correctly on the filedownload dialog, Actually the file
> name is shown as %EC%84%B8%EC%9D%BC%EB%9F%AC[1].doc on ms-word. ('Save as'
> shows the correct name)
>
> So, I look forward to finding the solution how to be accurately displayed
> the filename when I click "open button" whihout saving.
>
> If you know the mean I wish to know, plese give me some guide to solve
> this
> problem.
> Or, any recommnad is accepted any component or web browser to support the
> function to be displayed filename correctly when I open the attached file.
> (* Maybe I wonder how to solve this problem by any other Server-side
> Language( JSP, ASP.NET etc )
>
> as far as here, it's all my problem.
> From now on, I just wait your opinion. thank you~.
>
> Sample Code
> ================================
> <%@ Language=VBScript%>
> <%
>
> old_codepage = Session.CodePage
> Session.CodePage = "65001"
>
> file = "세일러.doc" '%EC%84%B8%EC%9D%BC%EB%9F%AC[1].doc
>
> encodename = Server.UrlEncode(file)
> delimiter = InStrRev(encodename, "%2E")
>
> if delimiter <> 0 then
> tempname = Left ( encodename, delimiter - 1 )
> temptype = Right ( encodename, Len(encodename) - delimiter - 2 )
> encodename = replace( tempname & "." & temptype, "+" ,"%20" )
> end if
>
> Response.ContentType = "application/unknown"
> Response.AddHeader "Content-Disposition","attachment; filename=" &
> encodename
>
> Set objStream = Server.CreateObject("ADODB.Stream")
>
> objStream.Open
> objStream.Type = 1
> objStream.LoadFromFile Server.MapPath("./data/")&"\"& file
>
> download = objStream.Read
> Response.BinaryWrite download
>
> Set objstream = nothing
>
> %>


 
Reply With Quote
Reply

Thread Tools
Display Modes

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
"this file could not be found" - Windows Mail cant open attached f devistated Windows Vista Mail 24 06-10-2009 10:44 PM
search > right click > open file location (or folder) CBoom Windows Vista General Discussion 7 02-19-2009 12:22 AM
Inability to open attached file john oh Windows Vista Mail 4 06-05-2008 04:25 AM
re: cannot display saved mhtml file with chinese characters correctly eddy Internet Explorer 0 06-04-2008 10:33 AM
Double Click to Open File Error Message Mike S. Windows Vista File Management 3 05-18-2007 08:55 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59