You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Daniel Zhang <zh...@clinicaltools.com> on 2003/08/06 14:29:33 UTC
Upload multiple files
Scott -
This question comes after Barry White's upload question. If I have
multiple files uploaded, one way is to send each file uploaded with
seperate soap request, but I don't think it's efficient. So the other
way I think, is to create a Datahandler array, then you send all files
in this array with single soap request, I think this is more efficient.
...
DataHandler[] dhArray = new DataHandler[fileNumber];
for (int i = 0; i < fileNumber; i++) {
dhArray[i] = new DataHandler(datasource[i]);
}
...
params.addElement(new Parameter("uploadfiles",
javax.activation.DataHandler[].class, dhArray, null));
...
The key point here is "javax.activation.DataHandler[].class" legal or
illiegal for class type? Or we have to do extra effort here?
TIA,
-Daniel
Re: Upload multiple files
Posted by Scott Nichol <sn...@scottnichol.com>.
It should be legal.
Scott Nichol
Do not send e-mail directly to this e-mail address,
because it is filtered to accept only mail from
specific mail lists.
----- Original Message -----
From: "Daniel Zhang" <zh...@clinicaltools.com>
To: <so...@ws.apache.org>
Sent: Wednesday, August 06, 2003 8:29 AM
Subject: Upload multiple files
> Scott -
>
> This question comes after Barry White's upload question. If I have
> multiple files uploaded, one way is to send each file uploaded with
> seperate soap request, but I don't think it's efficient. So the other
> way I think, is to create a Datahandler array, then you send all files
> in this array with single soap request, I think this is more efficient.
>
> ...
> DataHandler[] dhArray = new DataHandler[fileNumber];
> for (int i = 0; i < fileNumber; i++) {
> dhArray[i] = new DataHandler(datasource[i]);
> }
> ...
> params.addElement(new Parameter("uploadfiles",
> javax.activation.DataHandler[].class, dhArray, null));
> ...
>
> The key point here is "javax.activation.DataHandler[].class" legal or
> illiegal for class type? Or we have to do extra effort here?
>
> TIA,
>
> -Daniel
>
>
>
>