gpt4 book ai didi

html - 使用 formspree 上传文件

转载 作者:太空狗 更新时间:2023-10-29 15:55:00 24 4
gpt4 key购买 nike

我试图让我网站上的用户上传带有表单的图像。我一直在使用 formspree ( https://formspree.io/ )我收到了图片的名称,但电子邮件中没有附加图片。

我正在使用:

<label>
Upload Photo
<input type="file" name="uploadField" />
</label>

有没有人设法做到这一点?

最佳答案

Formspree 目前不支持文件输入,但是 Formsprees FAQ 有这样的建议:

For almost zero work and cheap (or free) prices you can integrate external file upload services into a Formspree form. Uploadcare is one example. If you just create an account and include their widget:

<!-- The best place for this one is your <HEAD> tag -->
<script>UPLOADCARE_PUBLIC_KEY = "demopublickey";</script>
<script
src="https://ucarecdn.com/libs/widget/3.x/uploadcare.full.min.js"
charset="utf-8"></script>

<!-- This is where the widget will be. Don't forget the name attribute! -->
<input type="hidden" role="uploadcare-uploader" name="my_file" />

Per their documentation, you can use that inside the Formspree form and receive the URL of the document in your email address.

来源:https://help.formspree.io/articles/6199-how-to-do-file-uploads-with-formspree

关于html - 使用 formspree 上传文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32429409/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com