Skip to main content


Showing posts from August, 2014

Odoo/ OpenERP: Calculate difference between two dates

from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta date_format = '%Y-%m-%d' joining_date = '2013-08-23' current_date = ( d1 = datetime.strptime(joining_date, date_format).date() d2 = datetime.strptime(current_date, date_format).date() r = relativedelta(d2,d1) print r.years print r.months print r.days Thanks!!!!!!!!! Enjoy Programming :)

File upload not working on PHP Server

Few days back, our team faced a new issue in file upload on server. It was restricting user to upload file size over 8KB while the following parameters were already set : php_value file_uploads  On php_value upload_max_filesize 200M php_value memory_limit  512M php_value post_max_size 200M php_value max_execution_time 1000 php_value max_input_time 300 but still file uploading was not working. Searched over internet and found that above problem was due to LimitRequestBody Directive of Apache. This parameter Restricts the total size of the HTTP request body sent from the client. "The LimitRequestBody directive allows the user to set a limit on the allowed size of an HTTP request message body within the context in which the directive is given (server, per-directory, per-file or per-location). If the client request exceeds that limit, the server will return an error response instead of servicing the request. The size of a normal request message body will vary greatly de