hey folks
i have an old application based on ASPmaker, which had FCKeditor built in. its basically a small Classic ASP system.
i changed the editor to CKeditor, newest version a few weeks ago,
the toolbars display properly.
but now, when the server-side code tries to read the textarea field -it doesnt seem to have access to anything, and it becomes empty.
the form, has an upload file input field, thus the systems uses a BLOBl reader to access the form fields.
i have put together a small demo, and can also paste some code.
again - the same code works perfectly with FCkeditor.
code follows below.
much appreciated in advance!
this is the HTML code:
this is the ASP function that reads the the fields and is supposed to response the values:
i have an old application based on ASPmaker, which had FCKeditor built in. its basically a small Classic ASP system.
i changed the editor to CKeditor, newest version a few weeks ago,
the toolbars display properly.
but now, when the server-side code tries to read the textarea field -it doesnt seem to have access to anything, and it becomes empty.
the form, has an upload file input field, thus the systems uses a BLOBl reader to access the form fields.
i have put together a small demo, and can also paste some code.
again - the same code works perfectly with FCkeditor.
code follows below.
much appreciated in advance!
this is the HTML code:
<form name="fNewsadd" id="fNewsadd" action="?cat=<%=x_cat_ID%>" method="post" enctype="multipart/form-data"> <input type="hidden" name="a_add" value="A"> <input type="hidden" name="EW_Max_File_Size" value="2000000"> <% If Session(ewSessionMessage) <> "" Then %> <p><span class="ewmsg"><%= Session(ewSessionMessage) %></span></p> <% Session(ewSessionMessage) = "" ' Clear message End If %> <table border="0" cellspacing="1" cellpadding="4" bgcolor="#CCCCCC"> <tr> <td class="ewTableHeader"><span>Title<span class='ewmsg'> *</span></span></td> <td class="ewTableAltRow"><span id="cb_x_title"> <input type="text" name="x_title" id="x_title" maxlength="255" size="70" value="<%= Server.HTMLEncode(x_title&"") %>"> </span></td> </tr> <tr> <td class="ewTableHeader"><span>Content</span></td> <td class="ewTableAltRow"><span id="cb_x_content"> <textarea cols="35" rows="4" id="x_content" name="x_content" class="editor"><%= x_content %></textarea> </span></td> </tr> <tr> <td class="ewTableHeader"><span>Upload Image</span></td> <td class="ewTableAltRow"><span id="cb_x_img"> <input type="hidden" name="a_x_img" value="3" /> <input type="file" id="x_img" name="x_img" size="30" /> <strong>Note</strong>: Image MUST be 443 pixels wide, by 296 high. </span></td> </tr> </table> <p> <input type="hidden" name="x_viewed" id="x_viewed" size="30" value="0"> <input type="button" name="btnAction" id="btnAction" value="ADD" onClick="EW_submitForm(this.form);"> </form>
this is the ASP function that reads the the fields and is supposed to response the values:
'call the function:
RequestBlobData()
Function RequestBlobData()
Dim rawData, separator, lenSeparator, dict
Dim currentPos, inStrByte, tempValue, mValue, value
Dim intDict, begPos, endPos
Dim nameN, isValid, nameValue, midValue
Dim rawStream
If Request.TotalBytes > 0 Then
Set rawStream = Server.CreateObject("ADODB.Stream")
rawStream.Type = 1 'adTypeBinary
rawStream.Mode = 3 'adModeReadWrite
rawStream.Open
rawStream.Write Request.BinaryRead(Request.TotalBytes)
rawStream.Position = 0
rawData = rawStream.Read
separator = MidB(rawData, 1, InStrB(1, rawData, ChrB(13)) - 1)
lenSeparator = LenB(separator)
Set dict = Server.CreateObject("Scripting.Dictionary")
currentPos = 1
inStrByte = 1
tempValue = ""
While inStrByte > 0
inStrByte = InStrB(currentPos, rawData, separator)
mValue = inStrByte - currentPos
If mValue > 1 Then
value = MidB(rawData, currentPos, mValue)
Set intDict = Server.CreateObject("Scripting.Dictionary")
begPos = 1 + InStrB(1, value, ChrB(34))
endPos = InStrB(begPos + 1, value, ChrB(34))
nameN = MidB(value, begPos, endPos - begPos)
isValid = True
If InStrB(1, value, stringToByte("Content-Type")) > 1 Then
begPos = 1 + InStrB(endPos + 1, value, ChrB(34))
endPos = InStrB(begPos + 1, value, ChrB(34))
If endPos > 0 Then
intDict.Add "FileName", ConvertToText(rawStream, currentPos + begPos - 2, endPos - begPos, MidB(value, begPos, endPos - begPos))
begPos = 14 + InStrB(endPos + 1, value, StringToByte("Content-Type:"))
endPos = InStrB(begPos, value, ChrB(13))
intDict.Add "ContentType", ConvertToText(rawStream, currentPos + begPos - 2, endPos - begPos, MidB(value, begPos, endPos - begPos))
begPos = endPos + 4
endPos = LenB(value)
nameValue = MidB(value, begPos, ((endPos - begPos) - 1))
Else
endPos = begPos + 1
isValid = False
End If
Else
nameValue = ConvertToText(rawStream, currentPos + endPos + 3, mValue - endPos - 4, MidB(value, endPos + 5))
End If
If isValid = True Then
If dict.Exists(byteToString(nameN)) Then
Set intDict = dict.Item(byteToString(nameN))
If Right(intDict.Item("Value"), 2) = vbCrLf Then
intDict.Item("Value") = Left(intDict.Item("Value"), Len(intDict.Item("Value"))-2)
End If
intDict.Item("Value") = intDict.Item("Value") & ", " & nameValue
Else
intDict.Add "Value", nameValue
intDict.Add "Name", nameN
dict.Add byteToString(nameN), intDict
End If
End If
End If
currentPos = lenSeparator + inStrByte
Wend
rawStream.Close
Set rawStream = Nothing
' Get action
sAction = getValue(dict, "a_add")
EW_Max_File_Size = getValue(dict, "EW_Max_File_Size")
x_newsID = getValue(dict, "x_newsID")
x_title = getValue(dict, "x_title")
x_content = getValue(dict, "x_content")
' Check the file size
If fs_x_img > 0 And CLng(EW_Max_File_Size) > 0 Then
If fs_x_img > CLng(EW_Max_File_Size) Then
Response.Write Replace("Max. file size (%s bytes) exceeded.", "%s", EW_Max_File_Size)
Response.End
End If
End If
fn_x_img = getFileName(dict, "x_img")
' Check the file type
If Not ewUploadAllowedFileExt(fn_x_img) Then
Response.Write "File type is not allowed."
Response.End
End If
ct_x_img = getFileContentType(dict, "x_img")
x_img = getFileData(dict, "x_img")
Call ewGetImageDimension(x_img, wd_x_img, ht_x_img)
If wd_x_img < 0 Or ht_x_img < 0 Then
wd_x_img = getValue(dict, "wd_x_img")
ht_x_img = getValue(dict, "ht_x_img")
End If
a_x_img = getValue(dict, "a_x_img")
If IsObject(intDict) Then
intDict.RemoveAll
Set intDict = Nothing
End If
dict.RemoveAll
Set dict = Nothing
RequestBlobData = True
response.Write("x_content = " & x_content)
response.Write("<br>x_title = " & x_title)
Else
RequestBlobData = False
End If
End Function

Re: problem, when upgrading from FCKeditor
Re: problem, when upgrading from FCKeditor
once i disabled it, it work.
i will send you the link in a PM, maybe you will be able to see what the issue with the function is
thanks again!
Re: problem, when upgrading from FCKeditor
I've never understood why browsers behave that way. It would be much saner if the onSubmit listener of a form was always called, no matter if it's being submitted for one reason or for another.