asp.net - 在提交给 HomeController 之前将 input[type=file] 转换为 Base64
问题描述
如何转换如下所示的 5 个单独的输入:
<form action="uploadImages" method="post" id="frm">
<input name="Img1" type="file" accept="image/*;capture=camera">
<input name="Img2" type="file" accept="image/*;capture=camera">
<input name="Img3" type="file" accept="image/*;capture=camera">
<input name="Img4" type="file" accept="image/*;capture=camera">
<input name="Img5" type="file" accept="image/*;capture=camera">
<input type="submit" value="Submit Form" class="UserSubmit" />
</form>
在发送到 HomeController 之前到 Base64 字符串。
文件类型将只是图像。(PNG/JPG)。
解决方案
推荐阅读
- python - 如何根据输入文件扩展名更改 pd.read_excel() 引擎?
- django - 无法从 django 中的模板调用第二个视图
- c# - System.InvalidOperationException:无法解析类型的服务 - 依赖注入
- powershell - 在 Windows10 Shutdown 中使用 popupmessage 执行 powershell 脚本
- shopify - 我们如何在shopify中拆分文本?
- jquery - .NET Framework 4.6.2 无法命中 POST 端点
- r - 使用 r 中的 ggplot2 沿 y 轴订购气泡图气泡
- kubernetes-ingress - k8s 入口无法路由到服务
- javascript - 来自外部库方法的 withProgress 的阻塞 UI 线程
- apache-spark - 检测到冲突的分区列名称 Pyspark Databricks