|
-
Jan 27th, 2005, 09:39 AM
#1
Thread Starter
Frenzied Member
Max Length
Im collecting data using an ActiveX control then sending it to my server program using the following on my web page.
Code:
<form
action="../test.exe"
method="POST" enctype="application/x-www-form-urlencoded"
name="frm">
<input type="hidden" name="Stage" value="100"><input
type="hidden" name="c" value="1"><input type="hidden"
name="ic" value="0"><input type="hidden" name="r" value="0"><input
type="hidden" name="d" value="0"><input type="hidden"
name="Ident" value="575182221677">
</form>
Are there any length limitations of
Code:
method="POST" enctype="application/x-www-form-urlencoded"
My program crashes when I have too much data and I am trying to track down the problem.
VBScript only has Variant type so if I was counting the length of a very long string it should automatically default to Long shouldnt it?
Last edited by agmorgan; Feb 16th, 2005 at 09:33 AM.
-
Jan 27th, 2005, 12:24 PM
#2
Thread Starter
Frenzied Member
Re: Max Length
After some more reading, it appears that GET is limited but POST is not.
I have tracked the crash down to the POST data not being fully read.
What reason could I have for my buffer not to read the entire string?
It seems to either be a time issue (not enough time to fill the buffer) or a length issue (too much data).
VB Code:
Declare Function ReadFile Lib "kernel32" _
(ByVal hFile As Long, _
lpBuffer As Any, _
ByVal nNumberOfBytesToRead As Long, _
lpNumberOfBytesRead As Long, _
lpOverlapped As Any) As Long
Sub GetFormData()
'====================================================
' Get the CGI data from STDIN and/or from QueryString
' Store name/value pairs
'====================================================
Dim sBuff As String ' buffer to receive POST method data
Dim rc As Long ' return code
' Method POST - get CGI data from STDIN
' Method GET - get CGI data from QueryString environment variable
'
If CGI_RequestMethod = "POST" Then
sBuff = String(lContentLength, Chr$(0))
rc = ReadFile(hStdIn, ByVal sBuff, lContentLength, lBytesRead, ByVal 0&)
sFormData = Left$(sBuff, lBytesRead)
' Make sure posted data is url-encoded
' Multipart content types, for example, are not necessarily encoded.
'
If InStr(1, CGI_ContentType, "www-form-urlencoded", 1) Then
StorePairs sFormData
End If
Else
'StorePairs CGI_QueryString
Call rep_error(16, "CGI Form Problem")
End
End If
End Sub
im at a loss
-
Jan 27th, 2005, 01:28 PM
#3
Thread Starter
Frenzied Member
Re: Max Length
hmm starting to think that it might be a server issue
http://support.microsoft.com/default...;EN-US;q260694
or maybe a max size of data on a form
http://support.microsoft.com/default...=kb;EN;q273482
Im not entirely sure what to do about it though
-
Feb 16th, 2005, 09:33 AM
#4
Thread Starter
Frenzied Member
Re: Max Length
Thats the trouble with legacy code.
Some of the libraries are not up to date!
The Do Loop fixed it!
You dont know how long this has been bugging me!
VB Code:
Sub GetFormData()
'====================================================
' Get the CGI data from STDIN and/or from QueryString
' Store name/value pairs
'====================================================
Dim sBuff As String ' buffer to receive POST method data
Dim rc As Long ' return code
' Method POST - get CGI data from STDIN
' Method GET - get CGI data from QueryString environment variable
'
If CGI_RequestMethod = "POST" Then
sBuff = String(lContentLength, Chr$(0))
[B] Do While Len(sFormData) < lContentLength
rc = ReadFile(hStdIn, ByVal sBuff, lContentLength, lBytesRead, ByVal 0&)
sFormData = sFormData & Left$(sBuff, lBytesRead)
Loop[/B]
' Make sure posted data is url-encoded
' Multipart content types, for example, are not necessarily encoded.
'
If InStr(1, CGI_ContentType, "www-form-urlencoded", 1) Then
StorePairs sFormData
End If
Else
'StorePairs CGI_QueryString
Call rep_error(16, "CGI Form Problem")
End
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|