novacode-nl / odoo-formio

Odoo Forms app & modules
https://apps.odoo.com/apps/modules/18.0/formio/
Other
69 stars 91 forks source link

File upload doesn't support the S3 storage in formio v15. #256

Closed mkumar-02 closed 1 year ago

mkumar-02 commented 1 year ago
  1. Created a form using form-builder.
  2. Added a file field which has the storage as 'S3'.
  3. Uploaded a file. Got the following error:

{"jsonrpc": "2.0", "id": null, "error": {"code": 404, "message": "404: Not Found", "data": {"name": "werkzeug.exceptions.NotFound", "debug": "Traceback (most recent call last):\n File \"/home/manoj/odoo/odoo-15.0/addons/http_routing/models/ir_http.py\", line 435, in _dispatch\n rule, arguments = cls._match(request.httprequest.path)\n File \"/home/manoj/odoo/odoo-15.0/addons/website/models/ir_http.py\", line 86, in _match\n return super(Http, cls)._match(path_info, key=key)\n File \"/home/manoj/odoo/odoo-15.0/odoo/addons/base/models/ir_http.py\", line 90, in _match\n return cls.routing_map().bind_to_environ(request.httprequest.environ).match(path_info=path_info, return_rule=True)\n File \"/home/manoj/.local/lib/python3.8/site-packages/werkzeug/routing.py\", line 1799, in match\n raise NotFound()\nException\n\nThe above exception was the direct cause of the following exception:\n\nTraceback (most recent call last):\n File \"/home/manoj/odoo/odoo-15.0/odoo/http.py\", line 654, in _handle_exception\n return super(JsonRequest, self)._handle_exception(exception)\n File \"/home/manoj/odoo/odoo-15.0/odoo/http.py\", line 301, in _handle_exception\n raise exception.with_traceback(None) from new_cause\nwerkzeug.exceptions.NotFound: 404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.\n", "message": "404 Not Found: The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.", "arguments": [], "context": {}}, "http_status": 404}}

  1. Which means, it does the POST call to /storage/s3 controller, which is missing.
  2. Tried adding my own /storage/s3 controller and the type of request was json.
  3. But the binary content of uploaded files is not being included in the payload.
bobslee commented 1 year ago

The S3 file provider isn't implemented in Odoo.

However you can use the formio_storage module - and setup Odoo (API) with S3 or other storage provider. https://apps.odoo.com/apps/modules/16.0/formio_storage_filestore/

Can you close this issue now ?

mkumar-02 commented 1 year ago

Thanks @bobslee