Skip to content

Problem with File.Download.bytes on Mobile Safari and Chrome #17

@jenfan

Description

@jenfan

I just copied good SSCCE example from #10

import Bytes.Encode as E
import File.Download as Download

main =
  Platform.worker
    { init = \() -> ( (), Download.bytes "word.txt" "text/plain" bytes )
    , update = \_ _ -> ( (), Cmd.none )
    , subscriptions = \_ -> Sub.none
    }

bytes =
  E.encode <| E.sequence <|
    List.map E.unsignedInt8 [ 101, 115, 115, 101, 110, 116, 105, 97, 108 ]

I started server with code above, went to it using mobile browsers (safari and crhome on iphone 7) and get weird errors, like trying to download files from server

here screenshots, Im sorry they are on russian, at least I can write translation of this :)
Safari is unabled to open page
Error: could not complete operation (WebkitBlobResource, error 1)
IMAGE 2019-03-17 23:16:48
unable to access site page temporarily unavailable or permanently moved to new address
IMAGE 2019-03-17 23:16:57
(tested on iphone 7)

And I cant figure out a way to save pdf file in my app for mobile users. The pdf file saves from server response after uploading form, (then it's generating and send back), so I dont have permanent link to file for easy way.
I will very appreciate for fixing this. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions