我使用Froala编辑器SDK上载图像,它可以完美工作,但是当我使用SDK上载文件时,我遇到了错误POST http://localhost/editeur/upload_file.php 404 (Not Found) file.min.js:7
,请提供一些帮助。
我在froala中使用了SDK示例,其中有示例代码的链接:https://www.froala.com/wysiwyg-editor/docs/sdks/php/file-server-upload
有我的代码:
<script type="text/javascript" src="./js/plugins/special_characters.min.js"></script>
<script type="text/javascript" src="./js/plugins/word_paste.min.js"></script>
<script type="text/javascript" src="./js/jquery-3.3.1.min.js"></script>
<script>
new FroalaEditor('#long_desc', {
// Set the file upload URL.
fileUploadURL: '/editeur/upload_file.php',
imageUploadURL: '/editeur/upload_image.php' }) </script> </body>
并且有upload_file.php
<?php
// Include the editor SDK. require
'wysiwyg-editor-php-sdk-master/lib/FroalaEditor.php';
// Store the file. try { $response =
FroalaEditor_File::upload('/editeur/files/uploads/'); echo
stripslashes(json_encode($response)); } catch (Exception $e) {
http_response_code(404); }
?>
图片上传单词完美(只需安装imagemagique扩展名)