I'm having problems uploading class in classic asp, I use to upload class upload image files and retrieve data from a form to insert, upload files is ok, but fails Unicode format
source code here: http://www.mediafire.com/file/6u67c0hx1ccmfgs/code-aspupload.rar
I have attached the file below, please help me.
Asked
Active
Viewed 1,147 times
0

user692942
- 16,398
- 7
- 76
- 175

Bầu Trời Đêm
- 1
- 1
-
Had the same problem, the upload class wasn't parsing the binary as UTF-8 so had to replace calls to convert binary to string with a UTF-8 version. See http://stackoverflow.com/a/37390834/692942 – user692942 Dec 02 '16 at 10:30
-
Also please read [ask] and consider providing a [mcve] of the problem, if you are having to provide external links to source code then the question is not defined enough and likely not on topic for [so]. – user692942 Dec 02 '16 at 16:18
1 Answers
-1
try adding the following code to your page (sorry, i'm unable to download your attachment at the moment so I can't see if you have it or not)
<%
Response.ContentType = "text/html"
Response.AddHeader "Content-Type", "text/html;charset=UTF-8"
Response.CodePage = 65001
Response.CharSet = "UTF-8"
%>

Josh Montgomery
- 882
- 5
- 10
-
That won't do anything, the problem is decoding the binary upload request. If the binary is uploaded and decoded into an ANSI character set because the upload process doesn't support decoding UTF-8 during the parse then whether you set UTF-8 for the response is irrelevant, the damage is already done. You'll just be encoding mismatched ANSI data back to UTF-8. – user692942 Dec 03 '16 at 23:01
-
<% Response.ContentType = "text/html" Response.AddHeader "Content-Type", "text/html;charset=UTF-8" Response.CodePage = 65001 Response.CharSet = "UTF-8" %> Yes ,I think problem not here ! – Bầu Trời Đêm Dec 05 '16 at 02:07