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

  • SEARCH
  • Home
  • 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 5947677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:59:51+00:00 2026-05-22T16:59:51+00:00

In a Google chrome extension I am working on, a file is downloaded from

  • 0

In a Google chrome extension I am working on, a file is downloaded from a server with an XMLHttpRequest. This file contains some binary data which are stored in an ArrayBuffer object. In order to provide the possibility to download this file I am using the createObjectURL API.

function publish(data) {
  if (!window.BlobBuilder && window.WebKitBlobBuilder) {
    window.BlobBuilder = window.WebKitBlobBuilder;
  }
  var builder = new BlobBuilder();
  builder.append(data);
  var blob = builder.getBlob();
  var url = window.webkitURL.createObjectURL(blob);
  $("#output").append($("<a/>").attr({href: url}).append("Download"));

}

It is working fine; except that the filename is an opaque UUID like 9a8f6a0f-dd0c-4715-85dc-7379db9ce142. Is there any way to force this filename to something more user-friendly?

  • 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-05-22T16:59:52+00:00Added an answer on May 22, 2026 at 4:59 pm

    I have never tried it before, but it should be possible to create a new File object (which allows you to specify a file name) and write your blob to it. Something along the lines of:

    function publish(data, filename) {
    
        if (!window.BlobBuilder && window.WebKitBlobBuilder) {
            window.BlobBuilder = window.WebKitBlobBuilder;
        }
    
        fs.root.getFile(filename, {
            create: true
        }, function (fileEntry) {
    
            // Create a FileWriter object for our FileEntry (log.txt).
            fileEntry.createWriter(function (fileWriter) {
    
                fileWriter.onwriteend = function (e) {
                    console.log('Write completed.');
                };
    
                fileWriter.onerror = function (e) {
                    console.log('Write failed: ' + e.toString());
                };
    
                var builder = new BlobBuilder();
                builder.append(data);
                var blob = builder.getBlob();
                fileWriter.write(blob);
    
            }, errorHandler);
    
        }, errorHandler);
    }
    

    I think this could work for you.

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

Sidebar

Related Questions

I included some adsense code in my google chrome extension popup file. Unfortunately this
I am working on my first chrome extension. I followed this article http://code.google.com/chrome/extensions/options.html to
I am working on creating a Google Chrome extension. We have it included in
Using a Google Chrome Extension, I would like to fire some event or somehow
we are in process of developing google chrome extension, in which we need to
I would like to write a small Google Chrome extension in which I use
At the moment I am developing a Google Chrome Extension in which I have
This is a very specific question for a Google Chrome extension. http://www.meebo.com/mobile/ This page
I'm working on a Google Chrome extension. In the popup I have the following
I'm writing a Google Chrome extension which manipulates the current page (basically adds a

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.