----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 04, 2001 1:43 AM
Subject: File uploads: binary and MIME encoded


> Hi,
>
>   I am interested in helping with part of the file upload task.
>

great :)

>   Currently I see two sets of functionality:
>
> 1) proper MIME encoded file uploads as specified in the todo list
> http://jakarta.apache.org/cactus/todo.html
>
> WebRequest.uploadFile(String nameOfFile, InputStream data, String
> dataEncoding)
>
> upload("myTextFile", textData, "text/plain")
> upload("myGif", giffData, "image/gif")
>
> example from:  http://www.w3.org/TR/REC-html40/interact/forms.html
> (at the bottom)
>
>
>
> 2) send a generic binary stream to the server
>
> WebRequest.uploadFile(InputStream)
>
> uploadFile( genericData )
>
>
>   I am interested in 2.  A quick fix is:
>
> modify WebRequest, adding uploadFile method and instance variable
>
> modify HttpClientHelper.addParametersUsingPost
> if uploadGenericData is set
>    open binary connection
>    send data
>    close
>    return
> else
>   continue with normal parameter processing
>
>
>
>   Is this reasonable?
>

that looks very fine to me !

>   How will the changes interact with the current development
> direction?
>

The only thing I'd like to do in the future is to ue HttpClient for
establishing the HTTP Connection to the server. That means using HttpClient
instead of HttpURLConnection. However, I have proposed (and already written)
a HttpURLConnection class that is a wrapper over HttpClient, meaning from a
HttpClient user point of view, there should be no differences. That said,
maybe HttpClient provide (or will provide) an API to upload files. It this
is the case, it would a normal choice for Cactus to use this API instead of
reinventing it.

Now, I think we should still go ahead with the change you propose and not
wait for HttpClient as it is not moving forward very fast and there is no
released date. At some point, we may need to get involved to get it going
... :-)

... In the meantime, let's do the change you proposed !

>
> Thanks
>
> Alvin
>

thanks
-Vincent


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to