私はこのチュートリアルを読んでいました。
http://ben.onfabrik.com/posts/pagedown-markdown-editor-custom-image-dialog
最後に ASP.NET コードがあります
[HttpPost]
public ActionResult EditorUpload(MediaEditorUploadModel model)
{
string result;
var serializer = new JavaScriptSerializer();
if (model.File.IsValidFile() && model.File.IsImage()) {
// upload the file
result = serializer.Serialize(
new { success = true, imagePath = "http://{the url of the uploaded image}"});
} else {
result = serializer.Serialize(
new { success = false, message = "Invalid image file"});
}
return Content(result); // IMPORTANT to return as HTML
}
しかし、PHPでどのように応答する必要があるのか わかりません。このコードを PHP に変換するのを手伝ってくれる人はいますか?