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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:49:37+00:00 2026-05-24T23:49:37+00:00

I am developing a social networking website and need to figure out a simple

  • 0

I am developing a social networking website and need to figure out a simple and intuitive way to store user-uploaded images on the server filesystem, one that will scale well as the site grows.

What I do is generate a path based on the timestamp of the image upload and name the file with an id corresponding to the record in the database. For example:

/server_img_path/<year>/<month>/<day>/<hour>/<minutes>/<seconds>/<milliseconds>/<img_id>.png

What do you think? Are there any flaws in doing it this way? Are there better ways? Thanks for your advise.

  • 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-24T23:49:37+00:00Added an answer on May 24, 2026 at 11:49 pm

    You are storing each file, effectively, in it’s own directory – the only way you would ever end up with two files in the same directory is if they were uploaded at the same millisecond. This will give you:

    • a load of pointless inodes
    • a filesystem that is a nightmare to navigate when you are maintaining it.

    Far better to seperate that data with dashes (-), underscores (_) or not at all.

    By all means store your files in seperate directories per-month (or even per-day, if there are enough being uploaded) but going any further than that is probably pointless unless you are, say, Facebook.

    Also, beacuse you are including an image ID, the milliseconds at least are pointless. If the ID corresponds to a primary key in a DB table, why not just call your file <id>.png and be done with it?

    I would suggest something more like this:

    /server_img_path/<year>/<month>/<day>/<hour><minutes><seconds><img_id>.png
    

    …or even better (and simpler)…

    /server_img_path/<year>/<month>/<img_id>.png
    

    KISS.

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

Sidebar

Related Questions

I'm currently developing a large site that handles user registrations. A social networking website
Hi I am developing social networking website and need a suggestion. I am using
I am developing a social network from scratch and need to store the user's
I am developing a social network from scratch and need to store the user's
We are developing something like a social networking website. I've got task to do
I am developing a social networking site. It has functionality like user registration, people
To be succinct: This startup is developing a social networking website specifically for video
I'm developing a social networking website, and improving the front-end with some spit and
I'm developing a REST API service for a large social networking website I'm involved
I'm developing a social game in Flash with a team of developers. Our server-side

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.