tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pankaj Tiwari <panky.tiw...@gmail.com>
Subject Re: multipart/form-data support
Date Tue, 04 Jan 2011 02:27:57 GMT
Hi Chris,

Thank you so much for pointing me to the right direction. The problem was
with my SERVERURL. The server was sending back the response as 200.

I should have checked that before :(

Thanks Again,
Pankaj

On Mon, Jan 3, 2011 at 11:29 PM, Christopher Schultz <
chris@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Pankaj,
>
> On 1/2/2011 10:06 PM, Pankaj Tiwari wrote:
> > I have been trying to send multipart/form-data to the server. I have
> found
> > that the request never reaches the server.
>
> How are you checking to see if it reaches the server?
>
> > This is my client code, if I am missing something core in here.
> >
> >     public static void main(String args[])
> >     {
> >         try
> >         {
> >             URL url = new URL(SERVERURL);
>
> What is SERVERURL?
>
> >             con.setDoInput(true);
> >             con.setDoOutput(true);
>
> ...
>
> >             OutputStream out = con.getOutputStream();
> >             DataOutputStream oos = new DataOutputStream(out);
>
> I agree with Pid: why are you using DataOutputStream?
>
> >             oos.writeBytes(TWOHYPHENS + BOUNDARY + LINEEND);
>
> Hmm... write before connect?
>
> >             oos.flush();
> >             con.connect();
>
> Try connecting before writing. Also, try reading the response (you did
> setDoInput(true)...).
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk0iDnEACgkQ9CaO5/Lv0PD6AQCfctFc2yULc7QkATMx1fAqwe5F
> km4AniigJu80/uJ6gl1Kg/6WD1i+rv/I
> =KmrY
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
Pankaj Tiwari

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message