如何在服务器端取得NMHTTP控件POST到服务器上的数据,用PHP或ASP等动态页面语言.
解决方案 »
- 数据库断网续传的问题
- 开源跨平台的pascal工具:lazarus(fpc)
- teechart中添加注释的问题?
- 千分散去还复来。。。。。散分了!!
- 要用图片切换特效,但是以前写的都是bmp的,jpg的有吗?? 比如下一段,谁能改成jpg的呢??
- 如何根据条件,令到LISTVIEW显示不同图标
- 提示实际参数和形式参数不匹配,怪事
- 请问哪位高手用过delphi7
- ********著名关心结贴率爱国人士者Ghyghost给大家送分了************
- 用Indy组件发送邮件时,程序会停止响应,不知道有什么好办法解决这个问题
- 强烈要求menggirl继续我们的斑竹职位。最后40分。放完换ID继续。
- 连接excel的问题
<%@ Language=VBScript %>
<script runat="server" language="vbscript">
Function GetUpload(FormData)
Dim DataStart,DivStr,DivLen,DataSize,FormFieldData
DivStr = LeftB(FormData,InStrB(FormData,StrToBin(VbCrLf))+1)
DivLen=LenB(DivStr)
PosOpenBoundary=InStrB(FormData,DivStr)
PosCloseBoundary=InStrB(PosOpenBoundary + 1,FormData,DivStr)
Set Fields=CreateObject("Scripting.Dictionary")
While PosOpenBoundary>0 And PosCloseBoundary>0
FieldNameStart=InStrB(PosOpenBoundary,FormData,StrToBin("name="))+6
FieldNameSize=InStrB(FieldNameStart,FormData,ChrB(34))-FieldNameStart
FormFieldName=BinToStr(MidB(FormData,FieldNameStart,FieldNameSize))
FieldFileNameStart=InStrB(PosOpenBoundary,FormData,StrToBin("filename="))+10
If FieldFileNameStart<PosCloseBoundary And FieldFileNameStart>PosopenBoundary Then
FieldFileNameSize=InStrB(FieldFileNameStart,FormData,ChrB(34))-FieldFileNameStart
FormFileName=BinToStr(MidB(FormData,FieldFileNameStart,FieldFileNameSize))
Else
FormFileName=""
End If
FieldFileCTStart=InStrB(PosOpenBoundary,FormData,StrToBin("Content-Type:"))+14
If FieldFileCTStart<PosCloseBoundary And FieldFileCTStart>PosOpenBoundary Then
FieldFileCTSize=InStrB(FieldFileCTStart,FormData,StrToBin(VbCrLf&VbCrLf))-FieldFileCTStart
FormFileCT=BinToStr(MidB(FormData,FieldFileCTStart,FieldFileCTSize))
Else
FormFileCT=""
End If
DataStart=InStrB(PosOpenBoundary,FormData,StrToBin(VbCrLf & VbCrLf))+4
If FormFileName<>"" Then
DataSize=InStrB(DataStart,FormData,DivStr)-DataStart-1
FormFieldData=MidB(FormData,DataStart,DataSize)
Else
DataSize=InStrB(DataStart,FormData,DivStr)-DataStart-2
FormFieldData=BinToStr(MidB(FormData,DataStart,DataSize))
End If
Set Field=CreateUploadField()
Field.Name=FormFieldName
Field.FilePath=FormFileName
Field.FileName=GetFileName(FormFileName)
Field.ContentType=FormFileCT
Field.Length=LenB(FormFieldData)
Field.Value=FormFieldData
Fields.Add FormFieldName,Field
PosOpenBoundary=PosCloseBoundary
PosCloseBoundary=InStrB(PosOpenBoundary+1,FormData,DivStr)
Wend
Set GetUpload=Fields
End FunctionFunction BinToStr(m_BinStr)
Dim varLen,Clow,ReturnStr,SkipFlag
SkipFlag=0
ReturnStr=""
If Not IsNull(m_BinStr) Then
varLen=LenB(m_BinStr)
For i=1 To varLen
If SkipFlag=0 Then
Clow=MidB(m_BinStr,i,1)
If AscB(Clow)>127 Then
ReturnStr=ReturnStr&Chr(AscW(MidB(m_BinStr,i+1,1)&Clow))
SkipFlag=1
Else
ReturnStr=ReturnStr&Chr(AscB(Clow))
End If
Else
SkipFlag=0
End If
Next
End If
BinToStr = ReturnStr
End Function
Function StrToBin(m_VarStr)
StrToBin=""
For i=1 To Len(m_VarStr)
VarChar=mid(m_VarStr,i,1)
VarAsc = Asc(VarChar)
If VarAsc<0 Then
VarAsc = VarAsc + 65535
End If
If VarAsc>255 Then
VarLow = Left(Hex(Asc(VarChar)),2)
VarHigh = Right(Hex(Asc(VarChar)),2)
StrToBin = StrToBin & ChrB("&H" & VarLow) & ChrB("&H" & VarHigh)
Else
StrToBin = StrToBin & ChrB(AscB(VarChar))
End If
Next
End FunctionFunction GetFileName(FullPath)
If FullPath <> "" Then
FullPath = StrReverse(FullPath)
FullPath = Left(FullPath, InStr(1, FullPath, "\") - 1)
GetFileName = StrReverse(FullPath)
Else
GetFileName = ""
End If
End Function
</script>
<script runat="server" language="jscript">
function CreateUploadField(){ return new UF_Init() }
function UF_Init(){
this.Name = null
this.FileName = null
this.FilePath = null
this.ContentType = null
this.Value = null
this.Length = null
}
</script>