pixer77
asked on
Microsoft VBScript runtime error '800a01b6' / Object doesn't support this property or method: 'Response.Form'
Hi ,
I am having problem while trying to send variables from a page to the Upload.
Can u please help me to resolve this issue?
Thank you in advance for ur help
Emiliano
Below the error i get when I add T1=Response.Form("T1") into outputfile.asp :
-------------------------- ---------- ---------- ----
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Response.Form'
/public/outputFile.asp, line 36
-------------------------- ---------- ---------- ---------
I attach here the scripts:
======= UPLOAD.ASP =================
<%Sub BuildUploadRequest(Request Bin)
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,g etByteStri ng(chr(13) ))
boundary = MidB(RequestBin,PosBeg,Pos End-PosBeg )
boundaryPos = InstrB(1,RequestBin,bounda ry)
Do until (boundaryPos=InstrB(Reques tBin,bound ary & getByteString("--")))
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Di ctionary")
Pos = InstrB(BoundaryPos,Request Bin,getByt eString("C ontent-Dis position") )
Pos = InstrB(Pos,RequestBin,getB yteString( "name="))
PosBeg = Pos+6
PosEnd = InstrB(PosBeg,RequestBin,g etByteStri ng(chr(34) ))
Name = getString(MidB(RequestBin, PosBeg,Pos End-PosBeg ))
PosFile = InstrB(BoundaryPos,Request Bin,getByt eString("f ilename=") )
PosBound = InstrB(PosEnd,RequestBin,b oundary)
If PosFile<>0 AND (PosFile<PosBound) Then
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,g etByteStri ng(chr(34) ))
FileName = getString(MidB(RequestBin, PosBeg,Pos End-PosBeg ))
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,g etByteStri ng("Conten t-Type:"))
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,g etByteStri ng(chr(13) ))
ContentType = getString(MidB(RequestBin, PosBeg,Pos End-PosBeg ))
UploadControl.Add "ContentType",ContentType
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,b oundary)-2
Value = MidB(RequestBin,PosBeg,Pos End-PosBeg )
Else
Pos = InstrB(Pos,RequestBin,getB yteString( chr(13)))
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,b oundary)-2
Value = getString(MidB(RequestBin, PosBeg,Pos End-PosBeg ))
End If
UploadControl.Add "Value" , Value
UploadRequest.Add name, UploadControl
BoundaryPos=InstrB(Boundar yPos+LenB( boundary), RequestBin ,boundary)
Loop
End Sub
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,in tCount,1)) )
Next
End Function%>
===== outputFile.asp ==========
<!--#include file="upload.asp"-->
<%
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCou nt)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Di ctionary")
BuildUploadRequest RequestBin
contentType = UploadRequest.Item("blob") .Item("Con tentType")
filepathname = UploadRequest.Item("blob") .Item("Fil eName")
filename = Right(filepathname,Len(fil epathname) -InstrRev( filepathna me,"\"))
value = UploadRequest.Item("blob") .Item("Val ue")
'Create FileSytemObject Component
Set ScriptObject = Server.CreateObject("Scrip ting.FileS ystemObjec t")
'Create and Write to a File
pathEnd = Len(Server.mappath(Request .ServerVar iables("PA TH_INFO")) )-14
Set MyFile = ScriptObject.CreateTextFil e(Left(Ser ver.mappat h(Request. ServerVari ables("PAT H_INFO")), pathEnd) & filename)
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close %>
===== that's the HTML for i am using to send the variable to the upload page ======
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<form METHOD="Post" name="prova1" ENCTYPE="multipart/form-da ta" action="public/outputFile. asp" >
t1:<input name="T1"><br>
File : <INPUT TYPE="file" NAME="blob"><BR>
<input type="submit" name="Insert" value="" >
</form>
</body>
</html>
I am having problem while trying to send variables from a page to the Upload.
Can u please help me to resolve this issue?
Thank you in advance for ur help
Emiliano
Below the error i get when I add T1=Response.Form("T1") into outputfile.asp :
--------------------------
Microsoft VBScript runtime error '800a01b6'
Object doesn't support this property or method: 'Response.Form'
/public/outputFile.asp, line 36
--------------------------
I attach here the scripts:
======= UPLOAD.ASP =================
<%Sub BuildUploadRequest(Request
PosBeg = 1
PosEnd = InstrB(PosBeg,RequestBin,g
boundary = MidB(RequestBin,PosBeg,Pos
boundaryPos = InstrB(1,RequestBin,bounda
Do until (boundaryPos=InstrB(Reques
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Di
Pos = InstrB(BoundaryPos,Request
Pos = InstrB(Pos,RequestBin,getB
PosBeg = Pos+6
PosEnd = InstrB(PosBeg,RequestBin,g
Name = getString(MidB(RequestBin,
PosFile = InstrB(BoundaryPos,Request
PosBound = InstrB(PosEnd,RequestBin,b
If PosFile<>0 AND (PosFile<PosBound) Then
PosBeg = PosFile + 10
PosEnd = InstrB(PosBeg,RequestBin,g
FileName = getString(MidB(RequestBin,
UploadControl.Add "FileName", FileName
Pos = InstrB(PosEnd,RequestBin,g
PosBeg = Pos+14
PosEnd = InstrB(PosBeg,RequestBin,g
ContentType = getString(MidB(RequestBin,
UploadControl.Add "ContentType",ContentType
PosBeg = PosEnd+4
PosEnd = InstrB(PosBeg,RequestBin,b
Value = MidB(RequestBin,PosBeg,Pos
Else
Pos = InstrB(Pos,RequestBin,getB
PosBeg = Pos+4
PosEnd = InstrB(PosBeg,RequestBin,b
Value = getString(MidB(RequestBin,
End If
UploadControl.Add "Value" , Value
UploadRequest.Add name, UploadControl
BoundaryPos=InstrB(Boundar
Loop
End Sub
Function getByteString(StringStr)
For i = 1 to Len(StringStr)
char = Mid(StringStr,i,1)
getByteString = getByteString & chrB(AscB(char))
Next
End Function
Function getString(StringBin)
getString =""
For intCount = 1 to LenB(StringBin)
getString = getString & chr(AscB(MidB(StringBin,in
Next
End Function%>
===== outputFile.asp ==========
<!--#include file="upload.asp"-->
<%
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCou
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Di
BuildUploadRequest RequestBin
contentType = UploadRequest.Item("blob")
filepathname = UploadRequest.Item("blob")
filename = Right(filepathname,Len(fil
value = UploadRequest.Item("blob")
'Create FileSytemObject Component
Set ScriptObject = Server.CreateObject("Scrip
'Create and Write to a File
pathEnd = Len(Server.mappath(Request
Set MyFile = ScriptObject.CreateTextFil
For i = 1 to LenB(value)
MyFile.Write chr(AscB(MidB(value,i,1)))
Next
MyFile.Close %>
===== that's the HTML for i am using to send the variable to the upload page ======
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
</head>
<body>
<form METHOD="Post" name="prova1" ENCTYPE="multipart/form-da
t1:<input name="T1"><br>
File : <INPUT TYPE="file" NAME="blob"><BR>
<input type="submit" name="Insert" value="" >
</form>
</body>
</html>
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For tim , you are right , I posted the wrong error, I meant :
--------------------------
Request object error 'ASP 0207 : 80004005'
Cannot use Request.Form
/public/outputFile.asp, line 36
Cannot use Request.Form collection after calling BinaryRead.
--------------------------
For kevp75 , I tryed UploadRequest.Item("T1") before posting and i got different errors becasue i forgot to add Item("Value")
UploadRequest.Item("T1").I
thank you anyway for your help, if you let mee how to split the points , i'll give them to both of you
cheers
emiliano