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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:42:25+00:00 2026-05-27T16:42:25+00:00

When user upload image I resize that image in 3 different sizes. I can’t

  • 0

When user upload image I resize that image in 3 different sizes. I can’t decide what is better option:

1) Save image path in one column in database like: User9876/ImageName and extension in another column. When I get user profile data from database I have business object with three properties for different image size. And in code I fill this properties by adding extension to image path from database like:

User9876/ImageName_Original.jpg
User9876/ImageName_Small.jpg
User9876/ImageName_Smallest.jpg

2) Or it is better to have three columns in database for each size?

  • 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-27T16:42:26+00:00Added an answer on May 27, 2026 at 4:42 pm

    Couple of recommendations:

    1. Don’t store the extension separately, unless you plan on querying for particular extensions. Just adds more complexity for no real gain.

    2. I would store the image size code as an id in your images table. This way you can update/edit image codes without having to run an update statement on your entire table.

      create table image (
      id int(11) unsigned not null auto_increment,
      path varchar(255) not null,
      size_code_id smallint(3) not null,
      PRIMARY KEY (id)
      )Engine=MyISAM Default Charset=utf8;

    Example row:

    1 | user9876/imagename_og.jpg | 1
    2 | user9876/imagename_me.jpg | 2
    3 | user9876/imagename_sm.jpg | 3
    

    This design will allow you to query for the ‘small’ image without having to parse the filename, yet you can still make the distinction of a small image from medium and original images on the filesystem.

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

Sidebar

Related Questions

In a rather simple ASP.NET application where the user can upload a image, mostly
I want to build an upload applet / desktop client that can resize -
I am building a web application that allows a user to upload an image.
How to make the browser upload and display image after the user puts it
Story: The user uploads an image that will be added to a photo gallery.
A user can upload a picture on my site at which point jQuery inserts
I have a form where the user can upload a zip file, it works
I have a page where a user can upload a file along with some
I have two resize functions that I would like to perform one after the
Can anyone recommend a plugin or library that allows people to upload images which

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.