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

Related Questions

I would like to send the message from HelloWorldLayer, and receive it in ScoreLayer,
I would like to send a javascript array to be processed by a method
I would like to send a html string with a GET request like this
I would like to send and receive OpenSoundControl in an AIR application, on the
I would like to send a list of Appointment s through WCF. My Interface
I would like to send out an update of my apk, but i did
I would like to send a struct from my client program to a server
I have completed my program and would like to send that program in its
I'm using a Rails application and would like to send/receive text messages through my
I have a window which is hidden and I would like to send a

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.