Re: [Cppcms-users] Check space left on device before file upload
Brought to you by:
artyom-beilis
From: Lee E. <lee...@gm...> - 2012-07-11 07:41:50
|
On Wed, Jul 11, 2012 at 8:09 AM, <ele...@ex...> wrote: > > 1) Check available disk space after client sent Content-Length header, > > decide whether to accept the request or not > > I suppose, the header could be forged, just like content-type. > > Even if it was not forged - the multi threaded nature of web apps (and OS for that matter) means that an available space now might not be there while the file uploads. > > 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) > > Please have a look at boost::filesystem::space_info as it should do the > trick. > > boost::filesystem::space_info will not tell you if the upload failed - the solution has to come from inside cppcms. The library needs to give some status for the file upload widget that will say whether the file was uploaded all right or not. The set() member function should give you this indication but it does not set to false if the upload fails to load completely Petr > > > > ------------------------------------------------------------------------------ > 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 > -- -- lee Lee Elenbaas lee...@gm... |