Yamada-san, Yamadaえりな wrote: : We are using mod_dav with apache2.4 to manage files via webdav protocol. : We want to limit file uploading based on the user's total storage. : For instance, if a user has his storage size reached to the max limit, he : can't upload files anymore. : Do you have any suggestions on how I can implement this by modperl?
This depends on how exact do you want the limiting to be. It is possible, for example, to write a PerlFixupHandler, hook on the PUT method, check for the storage used by that user, and then return something like Apache2::Const::HTTP_INSUFFICIENT_STORAGE or even ::FORBIDDEN if the storage space is exceeded. This does not catch the case when the user is below the allocated quota, but a large PUT request exceeds it, nor the case when multiple PUT requests are initiated at the same time. Depending on the backing storage, it could even be possible to map the problem to a filesystem quota. Hope this helps, -Yenya -- | Jan "Yenya" Kasprzak <kas at {fi.muni.cz - work | yenya.net - private}> | | http://www.fi.muni.cz/~kas/ GPG: 4096R/A45477D5 | We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise. --Larry Wall