Ted Vinke <[EMAIL PROTECTED]> wrote:
>    <mm:list
>                nodes="${pfid}"
>                path="projectfolder,blob"
>                fields="blob.title,blob.description,blob.date,blob.number"
>                orderby="blob.date"
>                directions="DOWN"
>              >
>     
>    I'm able to retrieve all information, but I found out the url
>    /mmbase/attachments/session=cloud_mmbase+48294/TestDocument.xls would also
>    need the actual name of the uploaded file, not just blob.title. But when I
>    extends the fields attribute with blob.handle I'm getting a
>     
>    javax.servlet.ServletException: SearchQuery...failed: ERROR: column
>    blob.handle does not exist 
>    errormessage. Since the original attachments-object has a handle, I should
>    be able to acces blob.handle too right? How else I'm a going to construct

I think the error is a bit confusing, because the field does indeed exist,
you only may not query it like this, because the _column_ might not.

>    the url to the file I want to download the file as in:
>    /mmbase/attachments/session=cloud_mmbase+[blob.number]/[blob.handle] (here
>    I ofcourse I'll have to use ${...} variables instead of [] :D) 


You cannot put a 'handle' in a String like this, because a 'handle' field
_is_ a blob. I think you might be confused by the name 'handle', which is
not a filename reference to an actual file. In some occasions (when e.g. you
store blobs as file, which is default for postgresql) the 'handle' column
does not even exist in the database so the field is purely 'virtual'.

Url's to the servlet should be generated automaticly by the functions on the
attachments builders, which is also done by the mm:attachment tag. I suppose
it would use the 'filename' field if it is available, and if it doesn't it
should. Btw, the filename is completely irrelevant for the servlet, which
only considers the number. The filename is only present in the URL because
it looks nice, and because it helps some browsers.

Michiel


-- 
Michiel Meeuwissen
Mediacentrum 140 H'sum 
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
 [] ()

Reply via email to