Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I gets an error due to can't get the value of textbox below:

ADODB.Stream error '800a0bb9'

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.


My HTML Codes

HTML
<form method="POST" action="?X=1" id="myForm">
    <input type="text" name="img_val" id="img_val" value="" />
    <input type="submit" value="Submit Largest Code" />
</form>


My ASP Codes:

<%

IF LEN(Request("X"))>0 THEN

base64String = Trim(Request.Form("img_val"))
Set tmpDoc = Server.CreateObject("MSXML2.DomDocument")
Set nodeB64 = tmpDoc.CreateElement("b64")
nodeB64.DataType = "bin.base64"
nodeB64.Text = Mid(base64String, InStr(base64String, ",") + 1)
set bStream = server.CreateObject("ADODB.stream")
bStream.type = 1
call bStream.Open()
call bStream.Write(nodeB64.NodeTypedValue)
caminho=Server.MapPath("/SS/imagem.png")
call bStream.SaveToFile(caminho, 2)
call bStream.close()
set bStream = nothing

END IF
%>


Sample Base64 code that I trying to post below:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAB4AAAAQFCAYAAABQN9UwAAAAAXNSR0IArs4c6QAA


What I have tried:

Hi All,

I'm trying post base64 code to save as an image but I can't post the value of textbox when I try submit my base64 code.

Is there limit send to codes via posting form?
Posted
Updated 27-Oct-17 7:49am

1 solution

The maximum POST size depends on web server and web browser. I have a feeling that the the Base64 sample on your post is partial and probably large. Since this is post under ASP classic, check
AspMaxRequestEntityAllowed
setting of your web server. That should give you some ideas.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900