meaningful web image filenames- max length

Discussion in 'Web Design and Development' started by macmesser, Oct 6, 2012.

  1. macrumors 6502

    Aug 13, 2012
    I'm replacing an Extensis Portfolio image database on the web with one embedded in an e-commerce system and I'm cleaning up the old database in preparation. One of the preps I'm doing on the old files is to rename them with meaningful English names, for which I'm writing an AppleScript. My question is how long can I or should I go with a filename phrase before I start breaking web pages or image links? Remember, these are file names not page titles. Obviously, the more information the better if no harm is done. Should I target a filename length of say 40-50 characters? Would 70 chars be too long? Any insights appreciated.
  2. macrumors member

    Sep 25, 2009
    Does the filename get shown in the URL? IE seems to limit the URL length to 2048 characters or fewer, while other browsers may allow more. So, from a technical point of few 70 characters sounds fine. Shorter names might be better if you except users to share links in some way, or reference them in printed documents.

    The operating system running your web server will have some sort of limit on filename length, but again it will be much more than 70.

    Longer names might help search engines find the pictures.

    Longer names will slow down your page load time slightly, if you have an HTML page referencing lots of long filenames.
  3. macrumors 68000


    Dec 7, 2007
    Alexandria, VA, USA
    max 70 sounds about right to me, too and convert special characters and spaces to underscores and allow dashes, then strip existing ext if any and check mime-type and add the proper dot extension through code if processing an upload server side. Makes it easily readable by humans and machines (i.e. semantic). The extension handling is optional, of course, it just is a safety check to ensure to extension is correct, makes sense to do this in the kind of project you are undertaking so I made mention of it.
  4. thread starter macrumors 6502

    Aug 13, 2012
    Thanks to both of you. I had decided on a length of 70 characters and will build them from custom fields used to record various attributes such as subject, artist, title, etc. in order to provide some content for image searching.

Share This Page