UB-Mannheim / ocr-fileformat

Validate and transform various OCR file formats (hOCR, ALTO, PAGE, FineReader)
https://digi.bib.uni-mannheim.de/ocr-fileformat/
MIT License
176 stars 23 forks source link

Web interface in Docker container/ Error when uploading document: "Must be either POST with the field 'file'...." #136

Open cboulanger opened 3 years ago

cboulanger commented 3 years ago

I am running the Web service in a Docker container. When trying to upload and process a file, I am getting the following Error: Must be either POST with file field 'file' or GET with param 'url'.

Bildschirmfoto 2021-05-13 um 12 37 58

Environment:

cboulanger commented 3 years ago

Ok, in the logs I see this:

[Thu May 13 10:41:22 2021] 172.17.0.1:63222 Accepted
[Thu May 13 10:41:23 2021] PHP Warning:  POST Content-Length of 14446932 bytes exceeds the limit of 8388608 bytes in Unknown on line 0
[Thu May 13 10:41:23 2021] 172.17.0.1:63222 [400]: POST /ocr-fileformat.php?do=transform&from=abbyy&to=page
[Thu May 13 10:41:23 2021] 172.17.0.1:63222 Closing

Seems like you need to increase the file size limit for PHP or, if you don't want to do that, provide an more informative error message.

stweil commented 2 years ago

The latest code no longer limits the upload size when running in a Docker container.