hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Bug in Part.java?
Date Thu, 10 Apr 2008 18:47:24 GMT

On Thu, 2008-04-10 at 19:24 +0200, Nicolas wrote:
> Hi Oleg,
> 
> Sorry for my rude answer.

Nicolas, there was nothing rude about it. It was all okay. However,
HttpClient is _not_ a browser, and therefore I do not find very
arguments like 'this works with a browser but does not work with
HttpClient' very convincing. Common browser applications tend be
optimized for compatibility with all sorts of broken CGI scripts out
there, very often at the expense of standards compliance.

According to my interpretation of the MIME specification both CRLF are
required. You are very welcome to double-check HttpClient code for
compliance with the MIME spec. 

Oleg

>  I didn't mean to offend anyone. Probably my 
> low english skills led to some understanding.
> I just wanted to tell you about the problem I had because I thought it 
> could have been a bug; if you think its correct like it is now, this is 
> fine for me.
> It's just strange that it is actually working when using plain html 
> forms to post the files...
> 
> Greetings,
> Nicolas
> 
> Oleg Kalnichevski wrote:
> > On Wed, 2008-04-09 at 21:33 +0200, Nicolas wrote:
> >   
> >> Hi Oleg,
> >>
> >> I don't think that it is a problem with the server side script as it 
> >> actually works when uploading binary files by using a web browser 
> >> interface...
> >>     
> >
> > Hi Nicolas
> >
> > You are very welcome to disagree. 
> >
> >
> >   
> >> so it's strange that it works when using a browser. The html 
> >> code for the file input is the following:
> >> <form action="/cgi-bin/download/option.cgi?name=add_submit" 
> >> method="post" enctype="multipart/form-data" name="upload_file">
> >> <input type="file" name="F_NAME" style="width:250">
> >> <input type="hidden" id="hname" value="">
> >> <button type="submit" value="upload">
> >>
> >> Somehow the server-side script seems the interpret the second CRLF as 
> >> being part of the file...
> >>     
> >
> > Feel free to check the relevant RFCs
> >
> > Oleg
> >
> >   
> >> Greetings,
> >> Nicolas
> >>
> >> Oleg Kalnichevski wrote:
> >>     
> >>> On Sun, 2008-04-06 at 19:41 +0200, Nicolas wrote:
> >>>   
> >>>       
> >>>> Hello everybody,
> >>>>
> >>>> I noticed that when I used the PostMethod and a FilePart in order to

> >>>> post a binary file to a server, the file was corrupt when it got to
the 
> >>>> server. When I compared the file on the server with the original one,
I 
> >>>> noticed that the file one the server had some bytes more at its 
> >>>> beginning than the original one. To resolve this problem, I commented

> >>>> out line 269 in method sendEndOfHeader in Part.java:
> >>>> protected void sendEndOfHeader(OutputStream out) throws IOException
{
> >>>>       LOG.trace("enter sendEndOfHeader(OutputStream out)");
> >>>>       out.write(CRLF_BYTES);
> >>>>       // 21.03.08 had to remove the second carriage return/line feed
> >>>>       // in order to work correctly with binary files and QNap...
> >>>>       //out.write(CRLF_BYTES);
> >>>> }
> >>>>
> >>>> Because I don't know whether this is really a bug or a user error of

> >>>> mine, I post it in the development mailing list...
> >>>>
> >>>> Greetings,
> >>>> Nicolas
> >>>>
> >>>>
> >>>>     
> >>>>         
> >>> Hi Nicolas
> >>>
> >>> I do not think it is a bug. The first CRLF pair terminates the header,
> >>> whereas the second one separates the part's head from part's content
> >>> body. This is likely to be a problem with the server side script 
> >>>
> >>> Hope this helps
> >>>
> >>> Oleg
> >>>
> >>>   
> >>>       
> >>>> ---------------------------------------------------------------------
> >>>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >>>> For additional commands, e-mail: dev-help@hc.apache.org
> >>>>
> >>>>     
> >>>>         
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> >>> For additional commands, e-mail: dev-help@hc.apache.org
> >>>
> >>>   
> >>>       
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
> > For additional commands, e-mail: dev-help@hc.apache.org
> >
> >   


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message