Skip to main content

Posts

Showing posts with the label File Upload

Odoo: Upload binary images from backend using API

If you want to upload a binary image to Odoo using API..here are the steps: controllers/main.py # -*- coding: utf-8 -*- from odoo.tools.translate import _ from odoo import http from odoo.http import request from odoo.addons import web from time import strftime import functools import datetime import json import base64 import sys import copy from dateutil import parser import logging from operator import itemgetter logger = logging.getLogger(__name__) def serialize_exception(f):     @functools.wraps(f)     def wrap(*args, **kwargs):         try:             return f(*args, **kwargs)         except Exception, e:             logger.debug("An exception occured during an http request")             #se = _serialize_exception(...

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 greatl...