Js 는 다음과 같은 것이 로드되는지 케디터:
CKEDITOR.replace( 'meeting_notes',
{
startupFocus : true,
toolbar :
[
['ajaxsave'],
['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
['Cut','Copy','Paste','PasteText'],
['Undo','Redo','-','RemoveFormat'],
['TextColor','BGColor'],
['Maximize', 'Image']
],
filebrowserUploadUrl : '/notes/add/ajax/upload-inline-image/index.cfm'
}
);
여기서 m 은 I& # 39, 함께 할 수 있도록 필 브라우저우프로더르. 당초 저게뭐지 uirl 케디터 돌아가려면 afaq afnor 프로세스를 작동합니까?
감사합니다
사용자 정의 가리키십시오 url 을 /dev/raw/raw200 필 브라우저 uirl 가질 수 있습니다.
나는 아직 내 프로젝트 중 하나로, 저는 이 자습서에 내 블로그에 올린 이 주제에 대해
http://www.mixedwaves.com/2010/02/integrating-fckeditor-filemanager-in-ckeditor/
자습서는 수 있는 방법에 대한 단계별 지침) 의 경우, 붙박이 통합하십시오 필 브라우저 프케디터 케디터 don& # 39 İç 밝힐 싶지 않다. 그 아주 단순합니다.
CKEDITOR.replace( 'editor1', {
filebrowserUploadUrl: "upload/upload.php"
} );
그리고 우프로d.프프 파일
if (file_exists("images/" . $_FILES["upload"]["name"]))
{
echo $_FILES["upload"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["upload"]["tmp_name"],
"images/" . $_FILES["upload"]["name"]);
echo "Stored in: " . "images/" . $_FILES["upload"]["name"];
}
무료 피르망거 보았으매 및 쉽게 구축할 수 있는 것이 케디터 통합할 수 있습니다.
http://labs.corefive.com/2009/10/30/an-open-file-manager-for-ckeditor-3-0/
이 프로젝트에 복제본에 다운로드 할 수 있습니다. 기본적으로 모든 지침을 피르망거 index. html 페이지 코드에 확장하지만 발생합니까 그냥 동일팔레트에 경로를 덧붙였다.
CKEDITOR.replace( 'meeting_notes',
{
startupFocus : true,
toolbar :
[
['ajaxsave'],
['Bold', 'Italic', 'Underline', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink' ],
['Cut','Copy','Paste','PasteText'],
['Undo','Redo','-','RemoveFormat'],
['TextColor','BGColor'],
['Maximize', 'Image']
],
filebrowserUploadUrl : '/filemanager/index.html' // you must write path to filemanager where you have copied it.
});
대부분의 언어가 지원됩니까 (php, asp, MVC & &; 영문 사스 -.)).
이후 이미지가 업로드됨 케디터 창이 나타납니다 이미 해당 컨텐츠를 모두 함께 할 수 있다.
<?php
set_time_limit ( 3600 )
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Content Editor</title>
<link href="jquery-ui-1.10.2/themes/vader/ui.dialog.css" rel="stylesheet" media="screen" id="dialog_ui" />
<link href="jquery-ui-1.10.2/themes/vader/jquery-ui.css" rel="stylesheet" media="screen" id="dialog_ui" />
<script src="jquery-ui-1.10.2/jquery-1.9.1.js"></script>
<script src="jquery-ui-1.10.2/jquery.form.js"></script>
<script src="jquery-ui-1.10.2/ui/jquery-ui.js"></script>
<script src="ckeditor/ckeditor.js"></script>
<script src="ckeditor/config.js"></script>
<script src="ckeditor/adapters/jquery.js"></script>
<script src="ckeditor/plugin2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#editor').ckeditor({ height: 400, width:600});
});
function placePic(){
function ImageExist(url){
var img = new Image();
img.src = url;
return img.height != 0;
}
var filename = document.forms['uploader']['uploadedfile'].value;
document.forms['uploader']['filename'].value = filename;
var url = 'http://www.mydomain.com/external/images/cms/'+filename;
document.getElementById('uploader').submit();
var string = CKEDITOR.instances.editor.getData();
var t = setInterval(function(){
var exists = ImageExist(url);
if(exists === true){
if(document.getElementById('loader')){
document.getElementById('loader').parentNode.removeChild(document.getElementById('loader'));
}
CKEDITOR.instances.editor.setData(string + "<img src=\""+url+"\" />");
clearInterval(t);
}
else{
if(! document.getElementById("loader")){
var loader = document.createElement("div");
loader.setAttribute("id","loader");
loader.setAttribute("style","position:absolute;margin:-300px auto 0px 240px;width:113px;height:63px;text-align:center;z-index:10;");
document.getElementById('formBox').appendChild(loader);
var loaderGif = document.createElement("img");
loaderGif.setAttribute("id","loaderGif");
loaderGif.setAttribute("style","width:113px;height:63px;text-align:center;");
loaderGif.src = "external/images/cms/2dumbfish.gif";
document.getElementById('loader').appendChild(loaderGif);
}
}
},100);
}
function loadContent(){
if(document.forms['editorform']['site'].value !== "" && document.forms['editorform']['page'].value !== ""){
var site = document.forms['editorform']['site'].value;
var page = document.forms['editorform']['page'].value;
var url = site+"/"+page+".html";
$.ajax({
type: "GET",
url: url,
dataType: 'html',
success: function (html) {
CKEDITOR.instances.editor.setData(html);
}
});
}
}
</script>
<style>
button{
width: 93px;
height: 28px;
border:none;
padding: 0 4px 8px 0;
font-weight:bold
}
#formBox{
width:50%;
margin:10px auto 0px auto;
font-family:Tahoma, Geneva, sans-serif;
font-size:12px;
}
#field{
position:absolute;
top:10px;
margin-left:300px;
margin-bottom:20px;
}
#target{
position:absolute;
top:100px;
left:100px;
width:400px;
height:100px;
display:none;
}
.textField{
padding-left: 1px;
border-style: solid;
border-color: black;
border-width: 1px;
font-family: helvetica, arial, sans serif;
padding-left: 1px;
}
#report{
float:left;
margin-left:20px;
margin-top:10px;
font-family: helvetica, arial, sans serif;
font-size:12px;
color:#900;
}
</style>
</head>
<body>
<?php
if(isset($_GET['r'])){ ?><div id="report">
<?php echo $_GET['r']; ?> is changed.
</div><?php
}
?>
<div id="formBox">
<form id="uploader" name="uploader" action="editaction.php" method="post" target="target" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="50000000" />
<input type="hidden" name="filename" value="" />
Insert image: <input name="uploadedfile" type="file" class="textField" onchange="placePic();return false;" />
</form>
<form name="editorform" id="editorform" method="post" action="editaction.php" >
<div id="field" >Site: <select name="site" class="textField" onchange="loadContent();return false;">
<option value=""></option>
<option value="scubatortuga">scubatortuga</option>
<option value="drytortugascharters">drytortugascharters</option>
<option value="keyscombo">keyscombo</option>
<option value="keywesttreasurehunters">keywesttreasurehunters</option>
<option value="spearfishkeywest">spearfishkeywest</option>
</select>
Page: <select name="page" class="textField" onchange="loadContent();return false;">
<option value=""></option>
<option value="one">1</option>
<option value="two">2</option>
<option value="three">3</option>
<option value="four">4</option>
</select>
</div><br />
<textarea name="editor" id="editor"></textarea><br />
<input type="submit" name="submit" value="Submit" />
</form>
</div>
<iframe name="target" id="target"></iframe>
</body>
</html>
, 는 작업이든지 avamar 페이지이므로 에디타크션.프프 디스크입니다. 높여줍니까 실제 파일 업로드:
<?php
//editaction.php
foreach($_POST as $k => $v){
${"$k"} = $v;
}
//fileuploader.php
if($_FILES){
$target_path = "external/images/cms/";
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(! file_exists("$target_path$filename")){
move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path);
}
}
else{
$string = stripslashes($editor);
$filename = "$site/$page.html";
$handle = fopen($filename,"w");
fwrite($handle,$string,strlen($string));
fclose($handle);
header("location: editor.php?r=$filename");
}
?>
< /html>;
이미지 업로드 통합할 수 있는 문제가 어떻게 내 최신값 크핀더 케디터. 이 솔루션을.
그리고 사용자의 웹 폴더에서는 케디터 다운로드하십시오 푸십시오 루트.
크핀더 다운로드하십시오 및 푸십시오 비트링 케디터 폴더에서는.
추가하고, 크핀더 케디터 대한 참조를 하고
id = " CKEditorControl1" CKEditor:CKEditorControl <;; ,, /CKEditor:CKEditorControl> 루나트 = " server" > <. 데이터베이스에구성원을 영문 페이지.
void 오버라이드합니다 금지되었는지 OnLoad (브렌타리스 e) { 크핀더스필레브라우저 _FileBrowser = new 크핀더스필레브라우저 (); _FileBrowser.BasePath = " ckeditor/ckfinder/";; _FileBrowser.SetupCKEditor (CKEditorControl1); }
공용 재지정입니다 부울 셰카우텐티카션 () { 진정한 반품하십시오. }
이미지 파일 추가 검사를 수행할 //. 세커이마지우프로즈 = true.
(출처)
버전 4, 서버 측에서 보상으론 JSON 편집기에는 케디터 함께 할 수 있을 것으로 기대하고 있다. 이전 버전 수준의 응답, 베어링 javascript 스니핏 text / html 필요할 수 있습니다. 이 링크를 참조 대한 설명은 해당 [형식식 반품해야 설명] [1]. C #, 서버 측에서 사용하는 경우, 다음과 같은 데이터 모델을 만들 수 있습니다
namespace editors.Models
{
public class PostModel
{
public string CKEditor { get; set; } // for older editors
public string CKEditorFuncNum { get; set; } // for older editors
public string langCode { get; set; } // for older editors
public int uploaded { get; set; }
public string filename { get; set; }
}
}
일상적인 대체하십시오 너회의 업로드하십시오 반품해야 및 결과.
PostModel fez = new PostModel { CKEditor = "TheEditor1", CKEditorFuncNum = "1", langCode = "en", uploaded = 1, filename = "/images/in/" + filenameVariable };
return Ok(fez);
아마 자동으로 수 있지만 대부분의 컨텐츠 유형에 반품하는 it json .net application / json 합니다.
As a 사이드 노트 필요로 하는 사람들을 위해 이미지 파일을 업로드된 파일을 상행담관염이라고 여부를 확인할 수 있다. 이 라이브러리는 코어 (Asp.net) 에서 사용하는 경우, 시스템스트로이 비표준 설치할 필요가 없다. # 39 의 Here& 할 방법
또한 인터넷 config. js 파일을 변경할 수 있는 유형 = & # 39 의 콘피g. 피르브로스럽로트메서드 , , # 39, & # 39 form& 권한과는 대조적으로 xhr& 콘피g. 피르브로스럽로트메서드 = # 39;;;
[1]: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_file_upload.html # 응답 파일 성공적으로 업로드되었습니다
이 단순한 의 데모 그리웠댔지 가져오는 데 도움이 될 수 있습니다. 다음은 html / php 코드 (where you want to 업로드하십시오 이미지:
<html>
<head>
<script src="http://cdn.ckeditor.com/4.6.2/standard-all/ckeditor.js"></script>
</head>
<body>
<form action="index.php" method="POST" style="width:500xp;">
<textarea rows="5" name="content" id="content"></textarea>
<br>
<input type="submit" name="submit" value="Post">
</form>
<script>
CKEDITOR.replace( 'content', {
height: 300,
filebrowserUploadUrl: "upload.php"
});
</script>
</body>
</html>
그리고 다음은 코드 우프로d.프프 절실해졌습니다.
<?php
if(isset($_FILES['upload']['name']))
{
$file = $_FILES['upload']['tmp_name'];
$file_name = $_FILES['upload']['name'];
$file_name_array = explode(".", $file_name);
$extension = end($file_name_array);
//we want to save the image with timestamp and randomnumber
$new_image_name = time() . rand(). '.' . $extension;
chmod('upload', 0777);
$allowed_extension = array("jpg", "gif", "png");
if(in_array($extension, $allowed_extension))
{
move_uploaded_file($file, 'upload/' . $new_image_name);
$function_number = $_GET['CKEditorFuncNum'];
$url = 'upload/' . $new_image_name;
$message = '';
echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($function_number, '$url', '$message');</script>";
}
}
?>
참고: # 39, t forget 폴더를 만들려면 don& " upload"; 같은 폴더에 파일을 렉시한테서 모든 세 같은 디렉터리입니다. 나중에 한 번 이해하겠니 작동하잖아 어떻게 그들의 디렉터리용 변경할 수 있습니다. 또한 잊지 않고 그림을 같이 누름에 서버로 보낸다.
결국 나는 [이 자습서는] (https://www.pluginsforckeditor.com/Tutorials/86/Upload-files-with-CKEditor/en/n86.aspx) 및 it to me 예쁜 것 없다는 것을 발견했다. 스택 오버플로 대한 조치도 이뤄질 경우, 내아기마저도 자습서에 frequencyid 제거됩니다. 일부 내용이 포함될 수 있는 이 적용된 자습서는 내아기마저도 제가 좀 더 유연한 솔루션입니다.
(Vmware. 이 글을 쓰는 모든 패키지에는 이 2 개의 애드온 기본 중 기본 하나, 그러나 제외한 추가할 수 있습니다)
케디터 smartupdate tahoma8 설치 파일을 업로드할 후에 필요한 작업을 진행 중이다.
네 케디토리요스 파일 링크 합니다,,, src = " ckeditor/ckeditor.js" 스크립트입니다 < 스크립트입니다 ',' 와 같은 > < /script> 어졌다면 초기화하십시오 있습니다.
$(document).ready(function() {
CKEDITOR.replace( 'editor1' );
});
<textarea name="editor1"></textarea>
이제 우리는 우리가 원하는 떠날려하면 케디터 활성하하려면 업로드. 이렇게 할 수 있습니다 'config.js& # 39 를 이동하여 케디터 폴더에서는 및 편집. 이 노선은 추가해야 합니다.
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.filebrowserUploadUrl = '/uploader/upload.php';
};
>. 참고: 이 프로젝트에서 url 은 루트. 어디에 있든지 이 파일을 불러오면 가져오기에서 사이트에서 시작할 것이라고 색인입니다. 즉, 'http://example.com/uploader/upload.php' 의 경우, 이 url 을 url 은 example.com
그 후, 케디터 구성 완료! 쉽구나 어?
사실, 지금 다시 가서 업로드 테스트 경우 자신의 이미지를 얻을 수 있습니다, 꽤 있지만, 아직 # 39 won& 업로드를 옵션을 사용할 수 없다.
이제 you& # 39 이 단계에서, it 'll 디이브이 전에 방정식입니다 motor1.1end 있는' 우프로d.프프 절실해졌습니다. 이 날 수 있을 수 있는 부분은 난처한 생각했어요 일부 기본 검색하기를 대체하십시오 내린 것으로 알고 있지만, 저는 다행히 I found 방정식입니다 작동됨 없습니다. "며" 이를 통해 더 많은 사용자정의를 일부 변경되었습니다.
그래서 let& 제공한 경로가, s go to # 39 마지막 단계에서, 연속성 유지를 위해 사용할 수 있는 이 자습서는 /uploader/upload.php '갈'.
이 위치에 우프로d.프프 ' (rec.601 했겠어)' 라는 파일을 만듭니다.
이 파일은 파일 업로드하는지 lionbridge 처리할 수 있는 것입니다.
>. 우프로d.프프:
<?php
// Upload script for CKEditor.
// Use at your own risk, no warranty provided. Be careful about who is able to access this file
// The upload folder shouldn't be able to upload any kind of script, just in case.
// If you're not sure, hire a professional that takes care of adjusting the server configuration as well as this script for you.
// (I am not such professional)
// Configuration Options: Change these to alter the way files being written works
$overwriteFiles = false;
//THESE SETTINGS ONLY MATTER IF $overwriteFiles is FALSE
//Seperator between the name of the file and the generated ending.
$keepFilesSeperator = "-";
//Use "number" or "random". "number" adds a number, "random" adds a randomly generated string.
$keepFilesAddonType = "random";
//Only usable when $keepFilesAddonType is "number", this specifies where the number starts iterating from.
$keepFilesNumberStart = 1;
//Only usable when $keepFilesAddonType is "random", this specifies the length of the string.
$keepFilesRandomLength = 4;
//END FILE OVERWRITE FALSE SETTINGS
// Step 1: change the true for whatever condition you use in your environment to verify that the user
// is logged in and is allowed to use the script
if (true) {
echo("You're not allowed to upload files");
die(0);
}
// Step 2: Put here the full absolute path of the folder where you want to save the files:
// You must set the proper permissions on that folder (I think that it's 644, but don't trust me on this one)
// ALWAYS put the final slash (/)
$basePath = "/home/user/public_html/example/pages/projects/uploader/files/";
// Step 3: Put here the Url that should be used for the upload folder (it the URL to access the folder that you have set in $basePath
// you can use a relative url "/images/", or a path including the host "http://example.com/images/"
// ALWAYS put the final slash (/)
$baseUrl = "http://example.com/pages/projects/uploader/files/";
// Done. Now test it!
// No need to modify anything below this line
//----------------------------------------------------
// ------------------------
// Input parameters: optional means that you can ignore it, and required means that you
// must use it to provide the data back to CKEditor.
// ------------------------
// Optional: instance name (might be used to adjust the server folders for example)
$CKEditor = $_GET['CKEditor'] ;
// Required: Function number as indicated by CKEditor.
$funcNum = $_GET['CKEditorFuncNum'] ;
// Optional: To provide localized messages
$langCode = $_GET['langCode'] ;
// ------------------------
// Data processing
// ------------------------
// The returned url of the uploaded file
$url = '' ;
// Optional message to show to the user (file renamed, invalid file, not authenticated...)
$message = '';
// in CKEditor the file is sent as 'upload'
if (isset($_FILES['upload'])) {
// Be careful about all the data that it's sent!!!
// Check that the user is authenticated, that the file isn't too big,
// that it matches the kind of allowed resources...
$name = $_FILES['upload']['name'];
//If overwriteFiles is true, files will be overwritten automatically.
if(!$overwriteFiles)
{
$ext = ".".pathinfo($name, PATHINFO_EXTENSION);
// Check if file exists, if it does loop through numbers until it doesn't.
// reassign name at the end, if it does exist.
if(file_exists($basePath.$name))
{
if($keepFilesAddonType == "number") {
$operator = $keepFilesNumberStart;
} else if($keepFilesAddonType == "random") {
$operator = bin2hex(openssl_random_pseudo_bytes($keepFilesRandomLength/2));
}
//loop until file does not exist, every loop changes the operator to a different value.
while(file_exists($basePath.$name.$keepFilesSeperator.$operator))
{
if($keepFilesAddonType == "number") {
$operator++;
} else if($keepFilesAddonType == "random") {
$operator = bin2hex(openssl_random_pseudo_bytes($keepFilesRandomLength/2));
}
}
$name = rtrim($name, $ext).$keepFilesSeperator.$operator.$ext;
}
}
move_uploaded_file($_FILES["upload"]["tmp_name"], $basePath . $name);
// Build the url that should be used for this file
$url = $baseUrl . $name ;
// Usually you don't need any message when everything is OK.
// $message = 'new file uploaded';
}
else
{
$message = 'No file has been sent';
}
// ------------------------
// Write output
// ------------------------
// We are in an iframe, so we must talk to the object in window.parent
echo "<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message')</script>";
?>
>. I made 이 클래스 파일 덮어쓰기는 지정/비활성화 사용할 수 있는 변경 및 don& 때, t # 39 덮어쓸지 파일을 위한 몇 가지 있습니다. 항상 옵션 없이 원래의 클래스 덮어씁니다.
기본적으로 이 클래스는 모든 파일, 설정 없이 계속 덮어쓰기는. 장난치지 필요에 따라 이러한 설정을 더 잘 수 있습니다.
if (true) {
echo("You're not allowed to upload files");
die(0);
}
이것은 보안을 위해. 여기서 는 사용자가 업로드 / 허용된 업로드입니다 로그인됨 확인해야 합니다. 그냥 하는 걱정이 없는 경우, re you& # 39 의 경우 이러한 줄 수 있습니다 (false) '' 코드 또는 설정되었습니다 제거하시겠습니까 redhat. 아닌 권장됨)
또한 '와' '변수' $ $ 바이로우 바스파스 편집해야 할 필요성 또는 다른 서버에 맞는 작동하지 않습니다. 아래 모든 것을 혼자 남을 수 있는 경우를 제외하고 주위에 놀이를하고 싶다.
>. 이 클래스 파일 보호, 제공하지 않을 수 있습니다, 그래서 사람들이 좀 더 쉽게 안전하다구요 좀 작업하려는 can& # 39, t, 바이러스 스크립트에만 업로드하십시오 서버에 대한.
Far as I 에 도움이 되기를 바란다, 너무 오래 하면 누군가가 이 작은 자습서는 협력했습니다 afaq afnor 일하고 싶은 나 다른 사람을 구할 수 있어요 어느 정도 시간이 됐으면 좋겠다 "고 말했다.
또한 일부 깔끔한 트러블슈팅 단계를 자습서에 링크됨 위에 있는 어떤 난 될 수 있는 # 39 의 경우 뭔가 잘못된 what& 찾을 수 있습니다.
이 코드를 사용할 수 있습니다.
<script>
// Replace the <textarea id="editor"> with a CKEditor
// instance, using default configuration.
CKEDITOR.config.filebrowserImageBrowseUrl = '/admin/laravel-filemanager?type=Files';
CKEDITOR.config.filebrowserImageUploadUrl = '/admin/laravel-filemanager/upload?type=Images&_token=';
CKEDITOR.config.filebrowserBrowseUrl = '/admin/laravel-filemanager?type=Files';
CKEDITOR.config.filebrowserUploadUrl = '/admin/laravel-filemanager/upload?type=Files&_token=';
CKEDITOR.replaceAll( 'editor');
</script>
서버측 url 을 가리키는 것으로 자체 파일 업로드 작업. 다행히 많이 들어가 있지만, t # 39 의 문서 doesn& 상세함을 일부 비워집니다 칠합니다 Don 존스 위치:
참고:
http://zerokspot.com/weblog/2009/09/09/custom-filebrowser-callbacks-ckeditor/