PRB: Query String Truncated (254786)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft Internet Explorer (Programming) 4.01 SP1
- Microsoft Internet Explorer (Programming) 4.01 SP2
- Microsoft Internet Explorer (Programming) 5
- Microsoft Internet Explorer (Programming) 5.01
- Microsoft Internet Explorer (Programming) 5.5
- Microsoft Internet Explorer (Programming) 5_beta
This article was previously published under Q254786 SYMPTOMS
When you send a long query string from a WinInet application to a Web server, the query string may be truncated.
CAUSE
This issue occurs because of the length limitation of the URL in WinInet, which is defined in the Wininet.h file as follows:
#define INTERNET_MAX_PATH_LENGTH 2048
#define INTERNET_MAX_SCHEME_LENGTH 32 // longest protocol name length
#define INTERNET_MAX_URL_LENGTH (INTERNET_MAX_SCHEME_LENGTH + sizeof("://") + INTERNET_MAX_PATH_LENGTH)
This behavior is by design. Note: Because Internet Explorer and Internet Transfer Control also use WinInet, the same issue may occur.
RESOLUTION
To resolve this issue, use the HTTP POST method. For example: Using Internet Transfer Control on the client side:
Private Sub Command1_Click()
Dim strData As String
strData = "QName=longquerystring+longquerystring+longquerystring+longquerystring"
Inet1.Execute "http://myserver/scripts/post.asp", "POST", strData, "Content-Type: application/x-www-form-urlencoded" & vbCrLf & "Connection: Keep-Alive"
End Sub
Using ASP on the server side:
<HTML>
<% cName = Request("QName") %>
<BODY>
Hello, the data you posted is: <br>
<% =CName %>.
</BODY>
</HTML>
or
<HTML>
<BODY>
Hello, the data you posted is: <br>
<%
Response.Write(Request.Form("QName"))
%>.
</BODY>
</HTML>
REFERENCES
For more information on URL-encoding and the format of a Form POST request, see section 8.2 in RFC 1866.
Modification Type: | Major | Last Reviewed: | 6/24/2005 |
---|
Keywords: | kbprb KB254786 |
---|
|