Hallo zusammen,
ich habe ein Problem beim Fileupload. Dieser funktioniert nur sporadisch oder eher gesagt eigentlich funktioniert es in den seltensten Fällen. Ich bekomme dann immer einen 400 early EOF in den basex-Logs angezeigt. Ich habe im Internet recherchiert und herausgefunden, dass dies wohl an dem Jetty Servlet Container liegt, habe aber noch keine Lösung dafür gefunden. Ein Update der Jetty Version bringt leider auch nichts.
Meine konkrete Implementierung schicke ich erst einmal nicht mit, da diese ja grundsätzlich funktioniert und ich eher vermute, dass das Problem eben am Jetty liegt.
Das komische ist, dass der Request korrekt vom Browser abgeschickt wird und ich den Server und den Client auf einem gemeinsamen Rechner laufen habe.
Hat jemand vielleicht ein ähnliches Problem oder dieses schon gelöst?
Viele Grüße
Florian
Hello Florian,
please note that this is an english-speaking mailing list. As many of our users are international, we want everyone to benefit from questions and answers, so I will answer in English. To clearify for non-german speakers: Florian was reporting about non-functioning file uploads.
Regarding your question: I assume you use the RestXQ stack. At the moment, RestXQ does not provide support for multipart data (as it is used in file uploads). However, Christian you yesterday implemented support for multipart/form-data in BaseX, see this commit:
https://github.com/BaseXdb/basex/commit/e139cf0748b156e4ac7ff6df33b98e82bc03...
So if you are using multipart/form-data in your request you might one to give it a try. Data will be put into a map and can be accessed this way. See the following snippet for an example (which I shamelessly stole from Christian, so kudos to him)
declare %rest:path("/upload") %rest:POST("{$files}") function local:xmpl($files) { for $name in map:keys($files) let $content := $files($name) let $size := count(convert:binary-to-bytes($content)) return <file name="{ $name }" size="{ $size }"/> };
You can give it a try using the latest snapshot. Please not, that this functionality is still experimental and subject to change. But we would be happy to get your feedback.
Cheers, Dirk
On 07/24/2013 01:57 PM, Florian Eckey wrote:
Hallo zusammen,
ich habe ein Problem beim Fileupload. Dieser funktioniert nur sporadisch oder eher gesagt eigentlich funktioniert es in den seltensten Fällen. Ich bekomme dann immer einen „400 early EOF“ in den basex-Logs angezeigt. Ich habe im Internet recherchiert und herausgefunden, dass dies wohl an dem Jetty Servlet Container liegt, habe aber noch keine Lösung dafür gefunden. Ein Update der Jetty Version bringt leider auch nichts.
Meine konkrete Implementierung schicke ich erst einmal nicht mit, da diese ja grundsätzlich funktioniert und ich eher vermute, dass das Problem eben am Jetty liegt.
Das komische ist, dass der Request korrekt vom Browser abgeschickt wird und ich den Server und den Client auf einem gemeinsamen Rechner laufen habe.
Hat jemand vielleicht ein ähnliches Problem oder dieses schon gelöst?
Viele Grüße
Florian
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk
So if you are using multipart/form-data in your request you might one to give it a try. Data will be put into a map and can be accessed this way. See the following snippet for an example (which I shamelessly stole from Christian, so kudos to him) [...]
Thanks Dirk, no reason to be shamed… @Florian: please note that the current implementation is still experimental, which means your feedback is welcome. I’ve just uploaded a new snapshot which supports multiple file uploads via HTML5. Regarding file sizes, I just succeeded in uploading a 200MB file.
Best, Christian
basex-talk@mailman.uni-konstanz.de