在Elm中上传文件 [英] File Upload in Elm

查看:203
本文介绍了在Elm中上传文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个人如何在Elm中上传文件(图片或Excel)?

How does one upload a file (image or excel) in Elm?

似乎找不到任何示例。

即使使用了本机代码,答案也很好。在 Elm-Html 中看到过 Data ,但似乎不支持文件和Blob。怎么办呢?

The answer is fine even if the native code is used. Have seen Data in Elm-Html but it appears files and blobs are not supported. What is the way around this?

推荐答案

我是MisterMetaphor所指的库的作者。虽然比他解释的要容易使用。看一下我如何在示例中设置elm-package.json: https://github.com/simonh1000/file-reader/blob/master/example/elm-package.json -只需添加 native-modules:是,

I am the author of the library MisterMetaphor refers to. It's easier to use than he explains though. Take a look at how I set up elm-package.json in the example: https://github.com/simonh1000/file-reader/blob/master/example/elm-package.json - just add "native-modules": true,.

我写了博客支持0.18版代码的发布,并展示如何上传到例如S3可以在榆木中完成。

I have written a blog to support the release of the code for 0.18 and show how uploads to e.g. S3 can be done in Elm.

这篇关于在Elm中上传文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆