[Seaside] Re: Rest - Ajax request - build file
Sebastien Audier
sebastien.audier at gmail.com
Fri Mar 20 04:48:30 UTC 2015
2015-03-19 15:46 GMT-10:00 Bob Arning <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.
>
> 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.
Did you need more informations ?
Thanks again,
--
Sébastien AUDIER
<http://www.objectfusion.fr/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20150319/fd26aa8f/attachment-0001.htm
More information about the seaside
mailing list