File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes What is best way to name jpg images in a web application? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "What is best way to name jpg images in a web application?" Watch "What is best way to name jpg images in a web application?" New topic
Author

What is best way to name jpg images in a web application?

Benjamin Weaver
Ranch Hand

Joined: Apr 08, 2003
Posts: 161
Hi all,

We are building a web application that will display metadata along with a jpg image. For performance reasons I have been advised to reference the jpg images by means of a path stored in a database column, rather than to store the image directly, as, say a BLOB, in the database. The jpg images would reside in a file directory outside the database.

Let's say each row of data will be associated with one jpg image. What is the best way of naming/referencing the associated jpg? by the unique id of the database row? It would be nice to give the jpg a name meaningful to the user, but the database id would be better, I would assume.

What do you all think?
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6662
    
    5

How about id_Name.jpg ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62279
    
  68

Will the name be user-facing? Most users could care less what the images are named.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62279
    
  68

Also, are the image files going to be part of the wbe app (and therefore directly referencable via URL) or stored separately?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: What is best way to name jpg images in a web application?