I use yaws 1.87
My case is:
-partial_post_size=10240

When upload process is running, not finish, web browser is sending data partially,
if i return Error in Appmod:out/0 function, the server  returns nothing to the browser even if i
set error code to 413.
(I use the tool HttpFox to track this, this tool is firefox add-on)
I attached an images of upload result: http://picasaweb.google.com/lh/photo/mzD_XqoM5DZ7XYl1b_3iZQ?feat=directlink

Cheers.

Steve Vinoski wrote:
On Thu, Jul 29, 2010 at 1:20 AM, Vu Hoang <hoanggiang@kokolink.net> wrote:
  
This error only raise when i set partial_post_size= integer(exp: 10240)
If i set it to no_limit, there is no problem, but i want to set it to an
integer because i want to stream the upload file chunk by chunk to handle
the large uploaded file
    

Any chance you could submit a test case that shows the problem? I
think what you're seeing is similar to another problem I was looking
at a couple weeks ago, but I'm swamped right now and don't really have
cycles to build my own test case to reproduce this.

Also, what version of Yaws are you running?

--steve


  
Cheers.

Vu Hoang wrote:

Sorry for my stupid question

I tried to write appmod to handle upload file,
When uploaded file size > option max_file_size( about 50MB for exp), in out
function, we have to return {ehtml, {p,[], "error message"}}, but the out
function is called twice and in browser, i see "Connection Interrupted".

This is my code:
out(Arg) ->

Options = [{max_file_size, 10000000}],
Ret = yaws_multipart:read_multipart_form(Arg, Options),
case Ret of
    {done, UploadParams} ->
        {ehtml, {p,[], "File upload done"}};
    {error, Reason} ->
        ErrDesc = wf:f("Error '~s'", [Reason]),
        {ehtml, {p,[], ErrDesc}};
    {get_more, Cont, NewState} ->
        {get_more, Cont, NewState};
    Other -> {ehtml, {p,[], "other reason"}}
end.

I use debugger to investigated the Arg variables:
with 1 upload request, there are 2 different Arg :
< Arg = {arg,#Port<0.14942>,

         {{10,30,255,12},33023},
         {headers,"keep-alive",
                  "text/html,applition....

< Arg = {arg,#Port<0.14947>,

         {{10,30,255,12},33076},
         {headers,"keep-alive",
                  "text/html,application

As you see there are 2 CliSock and 2 different Port number are created with
only 1 upload request.

I try with normal get request or upload request with file size <
max_file_size there are only 1 CliSock and the Arg is only 1, only 1 Port
number.

I also tried return HTTP error code 413, which means "Request Entity too
large"

 like this:

out(Arg) ->
    Options = [{max_file_size, 10000000}],
    Ret = yaws_multipart:read_multipart_form(Arg, Options),
    case Ret of
        {done, UploadParams} ->
            {ehtml, {p,[], "File upload done"}};
        {error, Reason} ->
            ErrDesc = wf:f("Error '~s'", [Reason]),
            [{status, 413}, {ehtml, {p,[], ErrDesc}}];
        {get_more, Cont, NewState}=More ->
            More;
        Other ->
            [{status, 500}, {ehtml, {p,[], "other reason"}}]
    end.

But the problem still the same.

With the uploaded file size < max_file_size, i uploaded ok without any
problem, no matter how large the file is.

Can you tell me how to deal with the case, when size > max_file_size.

Thank you very much.

________________________________
------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm

________________________________
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list


------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list