Re: file upload

"Kolja Lehmann" <[email protected]> Tue, 04 Jan 2005 12:02:11 +0100
Newsgroups gmane.comp.web.tclwebtest
Message-ID <opsj2rlxu4g27woa@lehmann>
Hi again

seems like I found the problem. Tomcat needs \r\n in the request instead =
=20
of simple \n. I dont know what the RFC says about this and it's well =20
possible AOLServer doesnt mind, but I would suggest changing the code lik=
e =20
this (I dont have access to the cvs, so maybe Peter or Tilman should do =20
that):

(proc do_request about line 2355 in tclwebtest.tcl)

     # Decide if we add parameters for a POST operation
     if { [string equal $enctype "multipart/form-data"] } {
         set query_content {}

         set boundary "-----NEXT_PART_[clock seconds].[pid]"
         foreach { elmname filename } $files {
             set fd [open $filename r]
             fconfigure $fd -translation binary
             if { [catch { read $fd [file size $filename] } data] } {
                 return -code error $data
             }
             close $fd
             append query_content "--$boundary\r\nContent-Disposition: =20
form-data;\
name=3D\"$elmname\"; filename=3D\"[file tail $filename]\"\r\n\r\n$data\r\=
n"
         }
         foreach { elmname data } $query_key_values {
             append query_content "--$boundary\r\nContent-Disposition: =20
form-data;\
name=3D\"$elmname\"\r\n\r\n$data\r\n"
         }
         append query_content "--${boundary}--"

Bye,
Kolja

Am Tue, 04 Jan 2005 11:26:07 +0100 schrieb Kolja Lehmann =20
<[email protected]>:

> Hi
> I am using the 1.0 version of tclwebtest and try to upload files. It =20
> doesnt seem to work, although the POST request generated seems good to =
=20
> me. Still the receiving tomcat server doesnt see the file nor any other=
 =20
> field i submitted. Are there any known issues with that?
>
> Kolja
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Tclwebtest-general mailing list
> Tclwebtest-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/tclwebtest-general




-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt