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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:32:50+00:00 2026-05-11T20:32:50+00:00

I would like to send dynamically created images to my users, such as charts,

  • 0

I would like to send dynamically created images to my users, such as charts, graphs etc. These images are “throw-away” images, they will be only sent to one user and then destroyed, hence the “no files involved”.

I would like to send the image directly to the user, without saving it on the file system first. With PHP this could be achieved by linking an image in your HTML files to a PHP script such as:

edit: SO swallowed my image tag:

<img src="someScript.php?param1=xyz">

The script then sent the correct headers (filetype=>jpeg etc) to the browser and directly wrote the image back to the client, without temporarily saving it to the file system.

How could I do something like this with a WSGI application. Currently I am using Python’s internal SimpleWSGI Server. I am aware that this server was mainly meant for demonstration purposes and not for actual use, as it lacks multi threading capabilities, so please don’t point this out to me, I am aware of that, and for now it fulfills my requirements 🙂

Is it really as simple as putting the URL into the image tags and handling the request with WSGI, or is there a better practise?

Has anyone had any experience with this and could give me a few pointers (no 32Bit ones please)

Thanks,

Tom

  • 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-11T20:32:50+00:00Added an answer on May 11, 2026 at 8:32 pm

    It is not related to WSGI or php or any other specific web technology. consider

    <img src="someScript.php?param1=xyz">
    

    in general for url someScript.php?param1=xyz server should return data of image type and it would work

    Consider this example:

    from wsgiref.simple_server import make_server
    
    def serveImage(environ, start_response):
        status = '200 OK'
        headers = [('Content-type', 'image/png')]
        start_response(status, headers)
    
        return open("about.png", "rb").read()
    
    httpd = make_server('', 8000, serveImage)
    httpd.serve_forever()
    

    here any url pointing to serveImage will return a valid image and you can use it in any img tag or any other tag place where a image can be used e.g. css or background images

    Image data can be generated on the fly using many third party libraries e.g. PIL etc
    e.g see examples of generating images dynamically using python imaging library
    http://lost-theory.org/python/dynamicimg.html

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

Sidebar

Ask A Question

Stats

  • Questions 142k
  • Answers 142k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer in the end i just wrote a small class that… May 12, 2026 at 8:13 am
  • Editorial Team
    Editorial Team added an answer I would use an event-based mechanism instead of polling. In… May 12, 2026 at 8:13 am
  • Editorial Team
    Editorial Team added an answer You could definitely do it that way. If it works… May 12, 2026 at 8:13 am

Related Questions

I'm sorry I could not think of a better title. The problem is the
I'm building a heavily CRUD based ASP.NET website and I've got to the phase
I have a page on which user can dynamically create some identical groups of
I would like to dynamically add fields to an ASP.NET MVC form with JQuery.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.