原来win端程序是用depha 写的请求参数可以直接传中文,nametxt="我的书籍",而现在 android端传不了中文参数,为了和win端保持一致,,现在的解决办法有一个,就是在android 端上传成功一个比如android.zip,然后把这个文件重命名为我的书籍.zip,再删除掉android.zip,以替换原来的我的书籍.zip,f求各位大神解决下。
```
<br>
<br>
<!--#include file="01.asp"-->
<%
Function URLDecode(enStr)
dim deStr,strSpecial
dim c,i,v
deStr=""
strSpecial="!""#$%&'()*+,.-_<=>?@[/]^`{|}~%"
for i=1 to len(enStr)
c=Mid(enStr,i,1)
if c="%" then
v=eval("&h"+Mid(enStr,i+1,2))
if inStr(strSpecial,chr(v))>0 then
deStr=deStr&chr(v)
i=i+2
else
v=eval("&h"+ Mid(enStr,i+1,2) + Mid(enStr,i+4,2))
deStr=deStr & chr(v)
i=i+5
end if
else
if c="+" then
deStr=deStr&" "
else
deStr=deStr&c
end if
end if
next
URLDecode=deStr
End function
Function CreateMultiFolder(ByVal CFolder)
Dim objFSO, PhCreateFolder, CreateFolderArray, CreateFolder
Dim i, ii, CreateFolderSub, PhCreateFolderSub, BlInfo
BlInfo = False
CreateFolder = CFolder
On Error Resume Next
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If Err Then
Err.Clear()
Exit Function
End If
If Right(CreateFolder, 1) = "/" Then
CreateFolder = Left(CreateFolder, Len(CreateFolder) -1)
End If
CreateFolderArray = Split(CreateFolder, "/")
For i = 0 To UBound(CreateFolderArray)
CreateFolderSub = ""
For ii = 0 To i
CreateFolderSub = CreateFolderSub & CreateFolderArray(ii) & "/"
Next
PhCreateFolderSub = Server.MapPath(CreateFolderSub)
If Not objFSO.FolderExists(PhCreateFolderSub) Then
objFSO.CreateFolder(PhCreateFolderSub)
End If
Next
If Err Then
Err.Clear()
Else
BlInfo = True
End If
CreateMultiFolder = BlInfo
End Function
dim upload
set upload = new AnUpLoad
upload.Exe = "*"
upload.MaxSize = 8 * 1024 * 1024 '8M
upload.GetData()
if upload.ErrorID>0 then
' response.Write upload.Description
else
dim file,savpath,dirc,FilesPath,nametxt,uid
savepath = "upload"
dirc=request.querystring("pathSplit")
dirc=replace(dirc,"%2F","/",1,-1,1)
nametxt=request.querystring("nametxt")
uid=server.URLEncode(request.querystring("uid"))
'response.Write URLDecode(dirc)
FilePaths= Server.Mappath("/") & "/tongbu/" & uid & "/" & "/" & dirc
Set Fso = Server.CreateObject("Scripting.FileSystemObject")
If Not Fso.FolderExists(FilePaths & "/tongbu/" & uid & "/" & dirc) Then CreateMultiFolder ("/tongbu/" & uid & "/" & "/" & dirc )
Set Fso = Nothing
for each frm in upload.forms("-1")
' response.Write frm & "=" & upload.forms(frm) & "<br />"
next
set file = upload.files("file1")
if not(file is nothing) then
result = file.saveToFile(FilePaths,0,true)
if result then{
response.Write "success" '& file.LocalName & "'上传成功,<br>文件保存地址<b><font color=blue>http://"&Request.ServerVariables("SERVER_NAME") & "/upload" & "/single/" & savepath & "/" & file.filename & "</font></b><br>文件大小" & file.size & "字节"
}
else
response.Write file.Exception
end if
end if
end if
set upload = nothing
%>
``` |