如何解决带有 MIME 类型文本/纯文本的 FilePond 样式表呈现
我正在开发一个非常简单的文件上传发布站点,我决定使用 FilePond。现在,我正忙于设置表单,以便准备好接受请求。我使用 express-ejs-layouts
来呈现我的应用程序,我的 layouts.ejs
文件如下所示:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<title>Cheese | <%= pageQuery %></title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/style.css">
<link href="https://unpkg.com/filepond/dist/filepond.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="https://unpkg.com/filepond/dist/filepond.js"></script>
</head>
<body>
<%- include('partials/header'); %>
<%- include('partials/navigation'); %>
<%- body %>
After
</body>
</html>
这个 FilePond 设置(JS 和 CSS)基本上是从他们的安装文档中复制的:https://pqina.nl/filepond/docs/patterns/installation/ 但是,由于某种原因,我收到了 Resource interpreted as Stylesheet but transferred with MIME type text/plain: "https://unpkg.com/filepond/dist/filepond.css".
警告,因此样式不会影响我的ejs。
作为参考,这是我的文件上传页面的视图:
<form action="" method="POST">
<input type="file" class="filepond" name="file">
<input type="text" name="title">
<input type="text" name="content">
<input type="submit" value="Post">
</form>
<%- include('../../partials/userFooter'); %>
我希望这是足够的信息。谢谢大家的帮助!
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。