[Seaside] Using nginx file upload module
Johan Brichau
johan at inceptive.be
Thu Jun 16 07:21:47 UTC 2011
Nick,
After writing my last response, I got the picture...
Because Seaside ignores whatever comes in the path after the application name, the request will be processed by the seaside app anyway. This is what I failed to see.
In our attempts, we _replaced_ the action url on the form by something like '/fileupload?_s=...&k=...'.
Instead, you merely _append_ to the action url such that it has the form: '/<app>/fileupload?_s=...&k=...'
That last url will be correctly handled as an incoming request for <app> by seaside, ignoring whatever comes after in the path.
Great 'aha!' moment ;-) Thanks!
Johan
On 16 Jun 2011, at 08:57, Johan Brichau wrote:
>
> On 15 Jun 2011, at 22:53, Nick Ager wrote:
>
>> Exactly. I think my rationale was that I wanted a way for the backend to communicate with Nginx that it should treat file upload request differently so I append 'fileupload' to the url. I tried adding a url parameter (eg ?fileupload=1&_s=...) but couldn't find a way to trap that within Nginx configuration. Originally I used #updateUrl: to add the 'fileupload' to the url, now I use javascript as I also add an 'X-Progress-ID=' for the upload tracking.
>
> Okay, so it's all a bit trickier than I thought.
> I was trying to rewrite the request to '/upload' after nginx has processed the file, such that the normal callback invocation of the seaside application can do its work with the request (except that a hidden field is required in this case).
> Unfortunately, that does not seem to work and you thus need to handle the '/upload' request in the seaside backend as well.
>
> I'm still not entirely convinced that a rewrite of the request in nginx after the file processing should not work though ;-) I will give it another try.
>
> But I'm looking forward to reading your write-up too!
>
> thanks again
> Johan_______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
More information about the seaside
mailing list