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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:31:11+00:00 2026-06-04T12:31:11+00:00

On my website; users can upload their pictures. I am using tomcat with apache

  • 0

On my website; users can upload their pictures. I am using tomcat with apache , hibernate, jpa.

I would prefer to keep these images at some location like /var/ImagesUploaded on my ubuntu box. Using Java I can refer these files in directory /var/ImagesUploaded using java.io but how will I show these images on HTML pages to user? On HTML files we need tags like <img src=''> and this src is relative to the webapp. So, is it that I have to keep the user uploaded images inside my webapp ONLY! Or is there a better solution?

  • 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-04T12:31:13+00:00Added an answer on June 4, 2026 at 12:31 pm

    How about reading the images on your application, and then serve them to your user as a base64 encoded stream? That way, you don’t have to expose your image directory to the web, and can effectively prevent it from being crawled by bots.

    1. Read the file as an InputStream inside your application using java.io
    2. Convert it to Base64 using Apache Commons Codec. encodeBase64URLSafeString(IOUtils.toByteArray(yourImageAsInputStream);
    3. In your response HTML, embed the image as <img src="data:image/jpeg;base64,encodedString">

    This post on SO might be useful as well.

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

Sidebar

Related Questions

I am creating a website, where users can upload their videos. I'm using the
I have a website where users can upload their files; these are stored on
My website would like users to upload their photos...but how do I keep our
I have website where users can login with their Facebook account. I am using
I am using PHP for a website. I have to get users upload their
I have a website that shows galleries. Users can upload their own content from
Using Magento i want to create website where user can upload their products to
My website allows users to upload their photos Can I put kb/sec (or similar)
I've a website where users can register. I would like to prevent all special
I'm working on a website where users can create and save their own HTML

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.