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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:58:59+00:00 2026-06-05T05:58:59+00:00

I am building a small web app that will allow a logged in user

  • 0

I am building a small web app that will allow a logged in user to upload product pictures. I’m trying to build-it-right, and after some naive implementations in the past, decided to add all uploaded content in my public folder.

\app (public folder)
-\index.php
\includes
\config
\uploads

This would make it so if a malicious user managed to upload a PHP file it wouldn’t be reachable or served by server.

That being said, how would I go about serving these pictures on the webpage? What is the best way to do this? In the past I’ve used a getImage.php file that would take an ID parameter (and a hash of some generated value to avoid users just guessing IDs) which would look like “getImage.php?id=555&c=44j54k3h5”. The server grabs the image information in the DB (the real path) and loads the content, rebuilds the header, and sends the image.

Are there any security concerns regarding this method? Is there a way to make it prettier? Would having a htaccess rewrite rule that looks for /images/imagename.jpg and sends them to my getImage.php file add security holes? Any advice on best practices would be greatly appreciated.

  • 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-05T05:59:00+00:00Added an answer on June 5, 2026 at 5:59 am

    Check out this class. It will handle the upload, do security checks and make you coffee 🙂

    http://www.verot.net/php_class_upload.htm

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

Sidebar

Related Questions

We are building a small web application in Rails that will allow clients to
I'm building a web app that has a grid of many small scrollable divs
I'm building a web-app that handles internal emails and other frequent small-to-medium sized chunks
I'm building a small web app that allows users to list their goals. I
I'm building a small web app in PHP that stores some information in a
I'm researching the idea of building a super-small (preferably PHP) web app, which will
I'm building a small app that takes things entered into an input field and
I'm building a small web app in Flash. Is there a solution to get
I am building a small web app. In the app I open a window
I'm building a small personal web app in Ruby on Rails. I've set it

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.