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 6190137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:31:59+00:00 2026-05-24T02:31:59+00:00

My Firefox addon downloaded the file and saved that at temp folder. In result

  • 0

My Firefox addon downloaded the file and saved that at temp folder. In result I have nsIFile instance.

How can I upload that file to another server? If I use XMLHttpRequest, I don’t understand how to pass that nsIFile to FormData.

Or, probably I shouldn’t just download the file and save that in the temp folder – since the only usage of this file is to be uploaded to another server. Probably, I should keep the file (file size ~20Kb) in the memory?

  • 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-24T02:32:02+00:00Added an answer on May 24, 2026 at 2:32 am

    If you are POSTing the data to the server as application/x-www-form-urlencoded then you should base64 encode it using btoa() and include it as one of the POST parameters in the request body (i.e. the string passed to XMLHttpRequest.send()):

    postbody = "body=" + btoa(fileContents);
    xhr.send(postbody);
    

    I agree that if you are just downloading the file and uploading it right away, you might as well keep it in memory since you’re presumably going to load it into memory anyway in order to base64 encode the contents.

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

Sidebar

Related Questions

There is an open source firefox addon that I have attempted to test with
I want to build a FireFox addon that can capture a webpage as an
In the firefox addon update dialog, a message tip will be displayed which can
Is there any firefox addon which can display my asp.net page viewstate size.... Any
I used to have a great Firefox add-on for this and I can't remember
I create a firefox addon with the online addon builder. How can one use
Does anybody know of a bookmarklet or firefox addon that let's you extract part
I want to write a firefox addon that replaces my current default download feature.
I am self-hosting a Firefox add-on that users can download from my website. When
I'm developing a firefox addon and would like to have a fixed position (relative

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.