提交 2b2ad993 编写于 作者: J Jakub

updated active storage overview guide by sanitizing direct upload file name

上级 40b7d93c
......@@ -661,10 +661,11 @@ To show the uploaded files in a form:
addEventListener("direct-upload:initialize", event => {
const { target, detail } = event
const { id, file } = detail
const sanitizedFileName = encodeURI(file.name)
target.insertAdjacentHTML("beforebegin", `
<div id="direct-upload-${id}" class="direct-upload direct-upload--pending">
<div id="direct-upload-progress-${id}" class="direct-upload__progress" style="width: 0%"></div>
<span class="direct-upload__filename">${file.name}</span>
<span class="direct-upload__filename">${sanitizedFileName}</span>
</div>
`)
})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册