[Cppcms-users] Check space left on device before file upload
Brought to you by:
artyom-beilis
From: Julian P. <ju...@wh...> - 2012-07-10 19:54:13
|
Hallo, on some of our embedded platforms a problem occurred that seems related to the fact, that libcppcms doesn't seem to check the available space in the location for uploaded files before it accepts an upload from the browser, resulting in incomplete files (libcppcms seems to throw away anything it can't write anymore). Nevertheless, there is no feedback given to our code that something went wrong during upload and our code can't show any specific error to the user because it doesn't know that there had been a problem during upload. In my opinion, libcppcms should do one (or maybe both) of these two things to help application code to display detailed error messages to the user: 1) Check available disk space after client sent Content-Length header, decide whether to accept the request or not 2) Notify the application code, that upload failed because of too less disk space (maybe one could do this via the existing infrastructure of invoking validate() on the upload form field's widget instance and adding another method that would return any occurred errors) Best regards, Julian |