html 업로드 양식을 표시하는 '업로드'jquery 대화 상자가 있습니다. 나는 코드가 작동했는지 확인할 수 있도록 PHP 폼 제출을 어디에서 처리 할 수 있습니까? 또한 페이지를 편집하는 도중 이미지가 업로드되므로 페이지가 다시로드되지 않고 변경 사항이 손실되지 않습니다 (이미지를 추가하기 전에 사용자가 편집 내용을 저장하지 않음). 업로드를 제출하고 대화 상자 내의 모든 내용을 유지하여 페이지가 다시로드되지 않도록 한 다음 업로드 된 이미지를 페이지에 삽입하는 '삽입'코드를 만들 수 있습니까? 덕분에, 내 코드는 다음과 같습니다jquery 대화 상자에 이미지 업로드
public static function uploadImage(){
global $wgOut, $wgRequest;
$posted = $wgRequest->wasPosted();
if($posted) {
$wgOut->addHtml(' Maximum upload size: 2M <br />');
}
// form processing message set at the top if(!empty($message)){$wgOut->addHtml('$message'); };
$wgOut->addHtml(' Upload an Image from your computer: <br />');
$wgOut->addHtml('<form action="" enctype="multipart/form-data" method="Post">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="file" name="file_upload" id="file_upload" />
<br />
<input type="submit" name="upload" value="Upload" />
</form>
');
$wgOut->addHtml(' Maximum upload size: 2M <br />');
$wgOut->addHtml('Permitted file types: png,gif,jpg,jpeg.');
}
JQuery와 :
$("#uploadImage")
.dialog({
autoOpen:false,
title: "Upload Image",
height: "auto",
width: 300
});
$("#uploadImage").dialog("open");
};
및
$wgOut->addHTML('<div id="uploadImage" style="display:none">');
$form = self::uploadImage();
$wgOut->addHtml($form);
$wgOut->addHTML('</div>');
나는 ajaxfileupload를 시험해보고있다. 그러나 나는 아약스 코드를 어디에 넣어야할지 모르겠다. 나는 대화 상자에 넣어 시도했지만 아무것도 발생하지 않습니다 : (. $는 ("# 업로드")입니다 (:) "확인") 경우 {\t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t $ ("#의 uploadImage") \t \t \t \t \t \t \t \t \t.대화 상자 ({ \t \t \t \t \t \t \t \t \t에 AutoOpen : 거짓, \t \t \t \t \t \t \t \t \t 제목 : "이미지 업로드", \t \t \t \t \t \t \t \t \t 높이 : "자동", \t \t \t \t \t \t \t \t \t 폭 : 300 \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t \t .ajaxStart (함수() { \t \t \t \t \t \t,321 0 \t $ (this) .show(); }) \t \t \t \t \t \t \t \t .ajaxComplete (함수() { \t \t \t \t \t \t \t \t $ (이) .hide(); \t \t \t \t \t \t \t \t}) }) ; – LTech
질문에 새 코드를 추가하는 것이 더 좋습니다. –