How can you integrate a custom file browser/uploader with CKEditor?

前端 未结 8 1577
南方客
南方客 2020-11-28 00:14

The official documentation is less than clear - what\'s the correct way to integrate a custom file browser/uploader with CKEditor? (v3 - not FCKEditor)

8条回答
  •  不知归路
    2020-11-28 00:50

    I spent a while trying to figure this one out and here is what I did. I've broken it down very simply as that is what I needed.

    Directly below your ckeditor text area, enter the upload file like this >>>>






    'and then add your upload file, here is mine which is written in ASP. If you're using PHP, etc. simply replace the ASP with your upload script but make sure the page outputs the same thing.

    <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
    <%
        if Request("CKEditorFuncNum")=1 then
            Set Upload = Server.CreateObject("Persits.Upload")
            Upload.OverwriteFiles = False
            Upload.SetMaxSize 5000000, True
            Upload.CodePage = 65001
    
            On Error Resume Next
            Upload.Save "d:\hosting\belaullach\senate\legislation"
    
            Dim picture
            For Each File in Upload.Files
                Ext = UCase(Right(File.Path, 3))
                If Ext <> "JPG" Then
                        If Ext <> "BMP" Then
                        Response.Write "File " & File.Path & " is not a .jpg or .bmp file." & "
    " Response.write "You can only upload .jpg or .bmp files." & "
    " & "
    " End if Else File.SaveAs Server.MapPath(("/senate/legislation") & "/" & File.fileName) f1=File.fileName End If Next End if fnm="/senate/legislation/"&f1 imgop = ";" 'imgop="callFunction('1','"&fnm&"',"");" Response.write imgop %>

提交回复
热议问题