dopo aver scandagliato nei meandri più bui della rete, sono finalmente riuscito a trovare una script che potesse aiutarmi ad iniziare; ve lo ripropongo già pronto per poter essere utilizzato:
Codice: Seleziona tutto
<?php
// 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 FCKeditor the uploaded file was sent as 'NewFile' but in CKEditor is 'upload'
if (isset($_FILES['upload'])) {
//Controlli
if(!($_FILES['upload']['type'] == "image/jpg") && !($_FILES['upload']['type'] == "image/jpeg") && !($_FILES['upload']['type'] == "image/png")){
exit("Bisogna caricare un'immagine");
}
$nometemp = $_FILES['upload']['tmp_name'];
$nomenew = $_FILES['upload']['name'];
$url = "http://".$_SERVER['SERVER_NAME']."/upload/".$nomenew; //qui ci sarà il path assoluto dell'immagine
move_uploaded_file($nometemp, $url);
}
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>";
?>
spero che vi sia di aiuto
ps: l'originale, che tuttavia è ancora incompleto, è a questo indirizzo
http://alfonsoml.blogspot.com/2009/12/u ... ditor.html