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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:41:13+00:00 2026-06-16T04:41:13+00:00

I have an application where some images will be dynamically created based on user

  • 0

I have an application where some images will be dynamically created based on user input and I need to send those images back to the user’s browser. Once the user leaves the page the images are on, the images won’t be needed anymore, so I just need them around long enough to serve them.

I understand how to use Ok(sendFile(...)) or Ok(stream(...)) within a controller to send the image data, but what I can’t wrap my head around is how I’d specify the path for the src in the img tag. More explicitly, I presume I will have something like

<img src=@routes.Controllers.serveImage(...) />

somewhere in my template.

Ideally, I wouldn’t have to create temp files to hold the images since that’s an awful lot of input/output that might not need to happen, although it does seem to be the easiest way to get a unique identifier that I could pass to the serveImage controller.

If I try to serve the images from memory, how would I provide a unique id for the image, make sure that it’s available in memory when the web browser asks for it, and get rid of it when it’s no longer needed?

Thanks!
Todd

  • 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-16T04:41:14+00:00Added an answer on June 16, 2026 at 4:41 am

    Generating unique ids is quite simple.

    The “serve the images from memory, […] get rid of it when it’s no longer needed” part sounds a lot like caching to me. Play provides a Caching API for that.

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

Sidebar

Related Questions

I have developed an iPhone application which will have some files (images, audio &
I have an application that takes some input and generates configuration files as output.
My application will have some customisation for each company that uses it. Up until
I am working on an iphone application that needs to send some images over
I have some C# code that will upload images and files into a db.
I have a problem: my application needs to draw some images on panels. I
I have an application with some bunch of code like this: errCode = callMainSystem();
I have an application with some in-app purchase in IPhone. Now i want to
I have an application with some sort of media playing and I do not
I have application with needs to have access to some sensitive data(in this case

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.