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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:24:47+00:00 2026-06-15T01:24:47+00:00

Context : I am building a site where a user uploads an image as

  • 0

Context:
I am building a site where a user uploads an image as part of the process of listing an item. I want to show them a preview of the image in the upload form, as it is both aesthetically pleasing, and will help the users in uploading and describing their items.

Problem:
In order to show a preview of the image, I need to upload it to my server, due to the sandboxing of browsers (I cannot get the image data into JS except by submitting the file-input form). However, we store the images using identifiers based upon data that the user inputs, in order to keep them organized (in our case, we sanitize the name and use that as a file name, in a /useruploads/user_id folder).

While I can change the naming scheme of the files in order to remove the dependency of user input (i.e. sha1 the file), uploading to s3 and resizing the image is an expensive operation, and I do not want to tie up resources unnecessarily. If I upload the image without resizing and generating thumbnails, then after the form containing the information about the item is submitted, the application will have to stream the data from S3, resize and generate thumbnails, and then re-upload the image(s), which seems somewhat roundabout.

I feel this is a pretty common problem, and I wonder if anyone has any patterns or advice on how to handle image uploads, in this regard.

  • 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-15T01:24:49+00:00Added an answer on June 15, 2026 at 1:24 am

    Using the FileReader API, you can actually read the binary blob from disk and then use that image purely client-side, before submitting the form!

    See http://www.onlywebpro.com/2012/01/24/create-thumbnail-preview-of-images-using-html5-api/

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

Sidebar

Related Questions

Im building multi-server support for a file upload site Im running. When images are
Background: I'm building a poetry site with user submitted content. The relevant user actions
I am building a site where users can upload content. As always I aim
For some context: I'm building a blog system where user can see all the
I'm building a mobile version of my site for smart-phones (iPhone/Blackberry/Android/WebOS) and I want
I'm building an MVC 3 site, and want to use Spring to provide run-time
I'm building a ruby recipe management application, and as part of it, I want
I am building something where contributors can post content to my site. I want
I'm currently building a site where I want anonymous users to see a page
I'm building my first node.js site with expressjs. Part of it is handling notifications

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.