F
FeelLikeANut
My question is partly a language issue (memory) and partly a Web issue
(where the program runs), so I hope everyone will be open to helping.
Users may submit and store pictures with my program. I have the choice
of storing these pictures either as files on the server or as a blob
in the database. The pictures are just user data, and it seems logical
to keep them in the database with all the other data. But I'm
concerned about how to serve these pictures. I can write a program to
handle image requests and return the appropriate picture from the
database. But it seems to me this means the picture will need to be
read from the database and stored in memory, in a variable, then
written from the variable to the HTTP response.
The part where the whole picture is stored in a variable is the part
that worries me. Is this impractical? Or merely a bad idea? Is storing
the pictures as files, allowing the server to serve them as it would
server anything else, the best option?
(where the program runs), so I hope everyone will be open to helping.
Users may submit and store pictures with my program. I have the choice
of storing these pictures either as files on the server or as a blob
in the database. The pictures are just user data, and it seems logical
to keep them in the database with all the other data. But I'm
concerned about how to serve these pictures. I can write a program to
handle image requests and return the appropriate picture from the
database. But it seems to me this means the picture will need to be
read from the database and stored in memory, in a variable, then
written from the variable to the HTTP response.
The part where the whole picture is stored in a variable is the part
that worries me. Is this impractical? Or merely a bad idea? Is storing
the pictures as files, allowing the server to serve them as it would
server anything else, the best option?