Re: [Cppcms-users] Check space left on device before file upload
Brought to you by:
artyom-beilis
From: Artyom B. <art...@ya...> - 2012-07-11 08:17:28
|
See, the code that handles file upload works before the request is handled to application, if the request fails the request would not even be transfered. If you afraid that there is not enough space, in the form you should reflect this in the upload form BEFORE user uploads the file. Also as Lee Elenbaas said, it is not really possible to check if there is enough space as it may be changed during upload progress. What would happen is that request would fail and the "temporary file should be deleted automatically" if it is not please fill a bug report. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/ >________________________________ > From: Julian Pietron <ju...@wh...> >To: cpp...@li... >Sent: Tuesday, July 10, 2012 10:36 PM >Subject: [Cppcms-users] Check space left on device before file upload > >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 > >------------------------------------------------------------------------------ >Live Security Virtual Conference >Exclusive live event will cover all the ways today's security and >threat landscape has changed and how IT managers can respond. Discussions >will include endpoint security, mobile security and the latest in malware >threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ >_______________________________________________ >Cppcms-users mailing list >Cpp...@li... >https://lists.sourceforge.net/lists/listinfo/cppcms-users > > > |