Forum OpenACS Q&A: Two questions

Collapse
Posted by Luis Garcia on
Hi,
I got a couple of questions regarding handling of mp3 files in OACS.
  • The first one has to do with configuring nsd so it can recognize .mp3 in the MIME section of it. I have tried several ways already and it does not work. Anyone knows how to do it?
  • The second one has to do with efficiency. If I am going to have mp3 files in my server from users, is it better to load them in the database (if it is possible at all as a blob, which I don't know either if it can be done), or to create sub-directories in my hard drive with the name of the userID or something to store them (which would require memory since mp3's are big)?
    Thanks in advanced!
  • Collapse
    2: Re: Two questions (response to 1)
    Posted by Tilmann Singer on
    I don't know enough about OpenACS'  new way of dealing with mime types, but maybe inserting the desired type in cr_mime_types manually will help (see acs-content-repository/sql/oracle/content-create.sql). Otherwise did you try adding a line in the nsd config file:

    ns_section "ns/server/${servername}/mimetypes"
    ns_param .mp3 audio/the-mp3-type

    Regarding storing the data in the db versus file system: you definitely want to use the content repository, which can transparently use either storage method. Check out one of the numerous posts here on that topic.

    Collapse
    3: Re: Two questions (response to 2)
    Posted by Jeff Davis on
    For 4.6.1 I added a fairly comprehensive list of mime types, fixed the *_maybe_create_mime_types functions and added a cr_mime_type_extension_map table which maps extension to mime type. Look at the cr_filename_to_mime_type function to see how it's handled there.

    As for storing large binary content, I think the answer for almost anyone is store it in the file system. You can do that with the content repository and storage type file.