All Projects → elm → File

elm / File

Licence: other
Select files. Download files. Work with file content.

Programming Languages

elm
856 projects

Projects that are alternatives of or similar to File

Downloader
Powerful and flexible Android file downloader
Stars: ✭ 193 (+101.04%)
Mutual labels:  download, file
Downgit
Create GitHub Resource Download Link
Stars: ✭ 936 (+875%)
Mutual labels:  download, file
github-content
Easily download files from github raw user content.
Stars: ✭ 21 (-78.12%)
Mutual labels:  download, file
Nodestream
Storage-agnostic streaming library for binary data transfers
Stars: ✭ 70 (-27.08%)
Mutual labels:  download, file
Digger
Digger is a lightweight download framework that requires only one line of code to complete the file download task
Stars: ✭ 521 (+442.71%)
Mutual labels:  download, file
Github Files Fetcher
Download a specific folder or file from a GitHub repo through command line
Stars: ✭ 73 (-23.96%)
Mutual labels:  download, file
Autocomplete
🔮 Fast and full-featured autocomplete library
Stars: ✭ 1,268 (+1220.83%)
Mutual labels:  select
Namava Downloader
Download movies from `namava.ir` website. | لینک جایگزین جهت احتیاط: https://gitlab.com/NabiKAZ/namava-downloader
Stars: ✭ 89 (-7.29%)
Mutual labels:  download
Fileinfo
📄Get information on over 10,000 file extensions right from the terminal
Stars: ✭ 86 (-10.42%)
Mutual labels:  file
Gimpshop Reloaded
✏️ GIMP mod to make it similiar to Adobe's product. Best free alternative to Photoshop
Stars: ✭ 81 (-15.62%)
Mutual labels:  download
Eureka
Need to encrypt a file before sending it to someone? This is it.
Stars: ✭ 92 (-4.17%)
Mutual labels:  file
Pastehere
A tool that helps you paste an image or text from your clipboard as a file
Stars: ✭ 92 (-4.17%)
Mutual labels:  file
Aria2.sh
Aria2 一键安装管理脚本 增强版
Stars: ✭ 1,276 (+1229.17%)
Mutual labels:  download
Docker Jdownloader
JDownloader 2 Docker Image (Multiarch) - Passed 40M Downloads
Stars: ✭ 85 (-11.46%)
Mutual labels:  download
Mecha
Mecha is a free flat-file content management system that carries the concept of minimalism.
Stars: ✭ 88 (-8.33%)
Mutual labels:  file
Vue Filepond
🔌 A handy FilePond adapter component for Vue
Stars: ✭ 1,263 (+1215.63%)
Mutual labels:  file
Okhttps
如艺术一般优雅,像 1、2、3 一样简单,前后端通用,轻量却强大的 HTTP 客户端(同时支持 WebSocket 与 Stomp 协议)
Stars: ✭ 92 (-4.17%)
Mutual labels:  download
Gokapi
Lightweight selfhosted Firefox Send alternative without public upload
Stars: ✭ 84 (-12.5%)
Mutual labels:  download
Ninaselectionview
Way to select your buttons.
Stars: ✭ 87 (-9.37%)
Mutual labels:  select
Filecontextcore
FileContextCore is a "Database"-Provider for Entity Framework Core and adds the ability to store information in files instead of being limited to databases.
Stars: ✭ 91 (-5.21%)
Mutual labels:  file

Files

Select files. Download files. Work with file content.

Maybe you generate an SVG floorplan or a PDF legal document? You can use File.Download to save those files to disk. Maybe you want people to upload a CSV of microbe data or a JPG of their face? You can use File.Select to get those files into the browser.

This package does not allow arbitrary access to the file system though. Browsers restrict access to the file system for security. Otherwise, any website on the internet could go try to read private keys out of ~/.ssh or whatever else they want!

Download Example

Maybe you want people to download the floorplan they just designed as an SVG file? You could use File.Download.string like this:

import File.Download as Download

download : String -> Cmd msg
download svgContent =
  Download.string "floorplan.svg" "image/svg+xml" svgContent

Upload Example

Maybe you want to help scientists explore and visualize data? Maybe they need to upload CSV files like this:

Name,Age,Weight,Height
Tom,22,63,1.8
Sue,55,50,1.6
Bob,35,75,1.85

You could use File.Select.file and File.toString to create a program like this:

import Browser
import File exposing (File)
import File.Select as Select
import Html exposing (Html, button, p, text)
import Html.Attributes exposing (style)
import Html.Events exposing (onClick)
import Task



-- MAIN


main : Program () Model Msg
main =
  Browser.element
    { init = init
    , view = view
    , update = update
    , subscriptions = subscriptions
    }



-- MODEL


type alias Model =
  { csv : Maybe String
  }


init : () -> (Model, Cmd Msg)
init _ =
  ( Model Nothing, Cmd.none )



-- UPDATE


type Msg
  = CsvRequested
  | CsvSelected File
  | CsvLoaded String


update : Msg -> Model -> (Model, Cmd Msg)
update msg model =
  case msg of
    CsvRequested ->
      ( model
      , Select.file ["text/csv"] CsvSelected
      )

    CsvSelected file ->
      ( model
      , Task.perform CsvLoaded (File.toString file)
      )

    CsvLoaded content ->
      ( { model | csv = Just content }
      , Cmd.none
      )



-- VIEW


view : Model -> Html Msg
view model =
  case model.csv of
    Nothing ->
      button [ onClick CsvRequested ] [ text "Load CSV" ]

    Just content ->
      p [ style "white-space" "pre" ] [ text content ]



-- SUBSCRIPTIONS


subscriptions : Model -> Sub Msg
subscriptions _ =
  Sub.none

From there you could parse the CSV file, start showing scatter plots, etc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].