Serving images

J

Jumping Arne

I'm no web programmer so please be kind.

I'm just going to start writing a small "web app", it's very small and will
only do one thing so I'm not going to use some kind of web framework.

The purpose of the script is to do some custom markup of markdown formatted
pages, render them and send them back to the browser. This is fairly simple
and I've done similar things before but this time I'm going to add support
for handling images.

Before I've just placed the images on a server where the script didn't need
to bother about it. Now I'm considering to let the script handle the images
also, that is serve them to the browser when requested. I've tried two
different approaches in other scripts:

+ Put them somewhere outside the scope of the script and link to them.

+ In my own code open the images, read the data and send it back
(is there a library for this?).

Before deciding on how to handle this for this script I would like to ask:
how is this best done? Is there a better way?
 
G

Gabriel Genellina

Before I've just placed the images on a server where the script didn't need
to bother about it. Now I'm considering to let the script handle the images
also, that is serve them to the browser when requested. I've tried two
different approaches in other scripts:

+       Put them somewhere outside the scope of the script and link to them.

+ In my own code open the images, read the data and send it back
  (is there a library for this?).

For static images, just let the webserver deal with them, surely will
do a better job.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top