cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ochoa Marcelo F." <moc...@ieee.org>
Subject Re: C2: Uploader needed
Date Thu, 14 Sep 2000 18:23:09 GMT
Rolande Kendal wrote:

> I think what this is leading up to is the need for a back-end data store --
> without it a method to upload would be rather useless. A worthwhile
> endevour to be sure. There are XML object stores available. I would
> familiarize myself with those and choose one based on suitable licensing,
> architecture, and support.
>
>

    I have a dowload / upload functionality in DB Prism 1.1.0 - dev which works
as Producer (Generator under 2.0) of Cocoon 1.7.x
(http://www.plenix.com/dbprism/)
    Basically its have a class MultiPartRequest which takes a servlet input
stream of type multipart/form-data, inserts the upload information into the DB
repository, and return a new object which implement HttpServletRequest interface
with the arguments parsed in the input stream + the file names uploaded in the
repository.
   If you agree i'll send the code.
   Regards, Marcelo.

PD: Ej. of use:
     String contentType = req.getHeader("Content-Type");
    HttpServletRequest request = null;
    if (contentType != null &&
contentType.toLowerCase().startsWith("multipart/form-data")) {
      // Handle multipart post, sent it as binary stream in a BLOB argument
      MultipartRequest multi = new MultipartRequest(req,this);
      request = multi;
    } else
      // if not multipart form-data request is equal to the original request.
      request = req;
    doIt(request,....);
....

 The table which holds the uploaded files is:
create table wpg_document
(
 NAME                                     VARCHAR2(64),
 MIME_TYPE                                VARCHAR2(48),
 DOC_SIZE                                 NUMBER,
 DAD_CHARSET                              VARCHAR2(128),
 LAST_UPDATED                             DATE,
 CONTENT_TYPE                             VARCHAR2(128),
 CONTENT                                  long raw,
 BLOB_CONTENT                             BLOB,
 constraint wpg_document_pk primary key( name )
)


Mime
View raw message