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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:23:18+00:00 2026-05-23T10:23:18+00:00

I want to allow a user to select an image from their local filesystem

  • 0

I want to allow a user to select an image from their local filesystem and then render this image to a canvas element on the page.

Due to the security constraints (‘sandbox’ browser security model), the client javascript cannot directly access the image on the filesystem, so it has to do a round trip to the server as ‘multipart/form-data’ from a file upload control.

I don’t want to actually save this image on the server and serve it out, since it’s only for one-time client-side manipulation purposes. So, I was wondering if is possible to convert the image data server-side into a base64 encoded representation which could be sent back to the client. Then I could easily draw it back to the client as a data URL without ever saving the image anywhere on the server. Or is there a better way?

I am using node.js on the server.

  • 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-23T10:23:18+00:00Added an answer on May 23, 2026 at 10:23 am

    I don’t see a need to save it on the server or incur the cost of Base64 encoding a data URI; just store it in memory long enough for the client to download. So your sequence will go something like this:

    1. The client uploads the image via a “multipart/form-data” submission.
    2. As the server receives the form it generates a “throw-away” URL (which could be, e.g., returned as the response body to the request in #1); the image file data is simply stored in memory.
    3. The client may retrieve the image data from the URL in #2.
    4. When the client requests the URL in #2 the server simply echoes the image data; upon completion of the request the server may drop the data reference, thus freeing the memory.

    Note that due to the asynchronous nature of both node.js and AJAX requests items 1-4 could be done concurrently (although the “throw-away” URL might have to be agreed upon separately from the form post for it to really work that way).

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

Sidebar

Related Questions

I want allow the user to customize their web pages on my ASP.NET MVC
I require to allow the user to select a file from the network drive
I want a to user a DateChooser to allow a user to select a
In my iPhone app, I want to allow the user to draw image by
Basically what I want to do is allow a user to type in a
I'm writing an user-driven app with several zones to it. I want to allow
friends, i am trying to display image from gallery now i want to put
I'm creating a web application installer using WiX. I want to allow the user
Say I have a 200x200 image. Then say I want to have a box
I need to load an image into my program. I want to allow the

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.