[Seaside] Re: Rest - Ajax request - build file
Bob Arning
arning315 at comcast.net
Fri Mar 20 11:47:53 UTC 2015
On 3/20/15 12:48 AM, Sebastien Audier wrote:
>
>
>
> 2015-03-19 15:46 GMT-10:00 Bob Arning <arning315 at comcast.net
> <mailto:arning315 at comcast.net>>:
>
> sounds like the sliced and non-sliced versions are posting in
> somewhat different ways.
>
>
> Yes, sounds like the sliced version is posting in different format.
> And may be, Zinc doesn't handle correctly.
So, how do you POST in the non-sliced version?
>
>
> does the sample code below work ok if the data is less than
> BYTES_PER_CHUNK? IOW, is the code ok for a single chunk POST, but
> failing for multiple chunks?
>
>
>
> Not only multiple chunks. Even if the file is smaller than the
> BYTES_PER_CHUNK limit, it doesn't work. It doesn't work with just one
> request.
>
>
> What does the receiving code look like? Is it different for the
> sliced and non-sliced versions?
>
>
> No it's the same method.
>
> Can you say more about what "return an error" is? Is there a
> debugger stack you could include?
>
>
>
> Okay, this is my post method on the handler.
>
> test
> <post>
> <produces: 'application/json; charset=utf-8'>
> | uploadedFile disk file |
>
> uploadedFile := self requestContext request postFields values first.
>
> "here, uploadedFile is a WAFile if we don't slice the file"
>
> [disk := (FileSystem disk workingDirectory / 'ressources' / 'upload').
> disk ensureDirectory.
> file := ((disk / (uploadedFile fileName)) ensureFile).
> file writeStreamDo: [:str |
> str
> nextPutAll: (uploadedFile rawContents)]] fork.
> ^''
>
>
>
> when I slice the file, the self requestContext return a signal does
> not undestood.
If there us a SqueakDebug.log (or similar), that would tell us exactly
what was not understood and by whom. Which might help us in determining
what's wrong with the POST.
>
>
> Did you need more informations ?
>
>
> Thanks again,
>
> --
> Sébastien AUDIER
>
>
> <http://www.objectfusion.fr/>
>
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150320/5f9e41d4/attachment.htm
More information about the seaside
mailing list