Giter Club home page Giter Club logo

Comments (12)

christianliebel avatar christianliebel commented on May 11, 2024 1

Yes, downloading on iPhone uses FileSaver.js, invoked with a blob. FileSaver.js then internally creates an a tag with a download attribute, then the download popup shows.

from jspaint.

1j01 avatar 1j01 commented on May 11, 2024 1

@DevJhns It may be a different version of Safari/iOS. Hopefully you can still save files tho if it opens in a new tab, with a long press on the image. Does that work?
JS Paint has File > Manage Storage by the way, if you didn't get it to save before.

from jspaint.

christianliebel avatar christianliebel commented on May 11, 2024 1

I need to get on which iphone models and which ios versions this Download popup works

@DevJhns a[download] is supported from iOS/Safari 13.0 onwards: https://caniuse.com/#feat=download

from jspaint.

1j01 avatar 1j01 commented on May 11, 2024

I don't have an iPhone, so I'd have to get an emulator to test this, but: eligrey/FileSaver.js#324
looks like I might just need to update FileSaver.js

from jspaint.

1j01 avatar 1j01 commented on May 11, 2024

Or it just doesn't work: eligrey/FileSaver.js#375

@evolveyourmind Do you get a new tab, or just nothing, or what?

from jspaint.

christianliebel avatar christianliebel commented on May 11, 2024

Saving on Safari/iPhone does actually work, users can choose to view/download the file (iOS 13.1.2).

iVBORw0KGgoAAAANSUhEUgAABaMAAAszCAYAAACIWkB7AAABgmlDQ1BzUkdCIElFQzYxOTY2LTIu-2

from jspaint.

1j01 avatar 1j01 commented on May 11, 2024

Okay, great!

from jspaint.

DevJhns avatar DevJhns commented on May 11, 2024

@christianliebel wow, great news!!!
Downloading on iphone works with filesaver.js or native saving from blobs?

from jspaint.

DevJhns avatar DevJhns commented on May 11, 2024

@christianliebel how you achieved this download pop up on iphone?
It works like in your photo on ipad, but on iphone all saved files open new tab (with blob url)

from jspaint.

DevJhns avatar DevJhns commented on May 11, 2024

@christianliebel thx for reply!
Yeah, I kinda get idea, how client-side blobs file saving works, except it doesn't work on Iphone, I can't get Downloads popup, file content opens in new safari tab with blob:45fc-... url
(but Downloads popup appears on Ipad, like on your photo in same situation)

something like this:

var blob = new Blob(receiveBuffer, {type: 'any/mimetype'});
a.href = URL.createObjectURL(blob);
a.download = 'filename.ext';

as I found out, this happens due to restrictions of iphone file system, but your image shows that this file managment works on iphone, how is this possible?

Does this file managment works only on iphone X and above?
Because I tried saving file from jspaint.app on iphone < X and nothing happened at all.
(with my script example above it opens file in new safari tab, not with safari file manager)

from jspaint.

DevJhns avatar DevJhns commented on May 11, 2024

@DevJhns It may be a different version of Safari/iOS. Hopefully you can still save files tho if it opens in a new tab, with a long press on the image. Does that work?
JS Paint has File > Manage Storage by the way, if you didn't get it to save before.

Yeah. problem that, I'm developing my own app, and this issue not related to jspaint actually, I need to download file (client side, from blobs) and it MUST be loaded in current tab, redirecting to other tab ruins all, and I don't want to store file on server, because file tranasfer happens peer to peer, soo all complicated, my app works everywhere except iphone (it opens file content in new tab, yeah file can be downloaded from new tab, but connection closes on redirect) so I need to get on which iphone models and which ios versions this Download popup works

thx for help!

from jspaint.

DevJhns avatar DevJhns commented on May 11, 2024

I need to get on which iphone models and which ios versions this Download popup works

@DevJhns a[download] is supported from iOS/Safari 13.0 onwards: https://caniuse.com/#feat=download

I know, but this pop up (Downloads block) https://user-images.githubusercontent.com/6698344/66068025-1f301c80-e54d-11e9-82eb-cbc5b33c8c3a.PNG

doesn't appear on ios 13.3 (not sure if it is iphone 7 or 8, just know it is < X)...
and you say this Download popup works on your iphone

from jspaint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.