Maybe the problem is the following:
If I execute the query using a simple string:
PICS2='testing string' the PICS2 column is updated correctly.
However, if I replace "testing string" with the Base64 string:
PICS2='" & base & "' the update does not work.
I have already checked the Base64 string with:
If Base64EncodeDecodeImage.ValidBase64(base) Then
Log("valid string")
End If
and it is reported as a valid Base64 string.
Therefore, the SQL query itself seems to work when the value is short, but it fails when I send the Base64 image string.
Could the problem be related to:
1) the SQL Server datatype/size of the PICS2 column;
ALTER TABLE STUDENT_PROFILE ALTER COLUMN PICS2 VARCHAR(MAX);
2) URL/HTTP encoding of the Base64 string
Dim su As StringUtils
Dim body As String = "query=" & su.EncodeUrl(sql, "UTF-8")
mianjob.PostString(MainUrl, body)
mianjob.GetRequest.SetContentType("application/x-www-form-urlencoded")
3) the ASP.NET NewRegistration.aspx page/request size limit;
If NewRegistration.aspx is classic ASP.NET (.NET Framework), httpRuntime maxRequestLength has a default value of 4096 KB.
Additionally, IIS has maxAllowedContentLength, which defaults approximately 28.6 MB.
<httpRuntime
and:
<requestLimits
For example, you might have:
<configuration>
<system.web>
<httpRuntime
maxRequestLength="20480"
executionTimeout="300" />
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="20971520" />
</requestFiltering>
</security>
</system.webServer>
</configuration>
Here, we have set the limit to approximately 20 MB:
maxRequestLength="20480"
is expressed in KB.
Whereas:
maxAllowedContentLength="20971520"
is expressed in bytes.
If ASP.NET exceeds maxRequestLength, the request may be blocked before NewRegistration.aspx even processes the code. IIS, on the other hand, may return a "413.1 Content Length Too Large" error (among others) when the content limit is exceeded.