Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8234551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:31:08+00:00 2026-06-07T18:31:08+00:00

Background I’m working on an internal project that basically can generate a video on

  • 0

Background

I’m working on an internal project that basically can generate a video on the client side, but since there are no JavaScript video encoders I’m aware of, I’m just exporting each frame individually. I need to avoid uploading to the server; this is all happening on the client side.

Implementation

I’m using this FileSaver.js (more specifically, Chrome’s webkit FileSystem API) to save a large number of PNGs generated by an HTML5 canvas. I set Chrome to automatically download to a specific folder, so when I hit ‘Save’ it just takes off and saves something like 20 images per second. This works perfectly for my purposes.

If I could use JSZip to compress all these frames into one file before offering it to the client to save, I would, but I haven’t even tried because there’s just no way the browser will have enough memory to generate ~8000 640×480 PNGs and then compress them.

Problem

The problem is that after a certain number of images, every file downloaded is empty. Chrome even starts telling me in the download bar that the file is 0 bytes. Repeated on the same project with the same export settings, the empty saves start at exactly the same time. For example, with one project, I can save the first 5494 frames before it chokes. (I know this is an insanely large number, but I can’t help that.) I tried setting a 10ms delay between saves, but that didn’t have any effect. I haven’t tried a larger delay because exporting takes a very long time as it is.

I checked the blob.size and it’s never zero. I suspect it’s exceeding some quota, but there are no errors thrown; it just silently fails to either write to the sandbox or copy the file to the user-specified location.

Questions

How can I detect these empty saves? Prevent them? Is there a better way to do this? Am I just screwed?


EDIT: Actually, after debugging FileSaver.js, I realized that it’s not even using webkitRequestFileSystem; it returns when it gets here:

if (can_use_save_link) {
    object_url = get_object_url(blob);
    save_link.href = object_url;
    save_link.download = name;
    if (click(save_link)) {
        filesaver.readyState = filesaver.DONE;
        dispatch_all();
        return;
    }
}

So, it looks like it’s not even using the FileSystem API, and therefore I have no idea how to empty the storage before it’s full.


EDIT 2: I tried moving the “if (can_use_save_link)” block to inside the “writer.onwriteend” function, and changing it to this:

if (can_use_save_link) {
    save_link.href = file.toURL();
    save_link.download = name;
    click(save_link);
}else{
    target_view.location.href = file.toURL();
}

The result is I’m able to save all 8260 files (about 1.5GB total) since it’s now using storage with a quota. Before, the files didn’t show up in the HTML5 FileSystem because I assume you didn’t need to put them there if the anchor element supported the ‘download’ attribute.

I was also able to comment out the code that appends “.download” to the filename, and I had to provide an empty anonymous function as an argument to both instances of “file.remove()”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:31:10+00:00Added an answer on June 7, 2026 at 6:31 pm

    I ended up modifying FileSaver.js (see “EDIT 2” in the original post).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background This is only my second PyQt4 project. Developing a Windows app that has
Background My project is urgent and requires that I iterate a large XML file
Background I'm writing an app that uses the ViewPager and that's working nicely. I
BACKGROUND: There is a publicly available Facebook business page, I can see the entire
Background: We're building an application that allows our customers to supply data in a
Background: I would like to dismiss a modalView that I have presented earlier and
Background I am working with a monad built of a stack of transformers one
Background: I have a css and a js that is used only by the
Background: My employeer at my non-programming job knows that I am an undergraduate CS
Background: I have a website where people can store transactions. As part of this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.