I’ve been using this method and set Employee (because I’m using Employee Login) permission to the doc “r and w” and always got 403, even though with administrator, system engineer.
I’ve successfully upload the image but the problem is with permission, the server said, not permitted , what method to pass this error while uploading attachment ?
I hope someone would tell what method they use to upload the attachment properly from android apps.
do you get some answer to solve this issue ? i have some problem too about post image, when im using Token Auth , its give me response 403 Forbidden , but if im using method/login its success to post image
Messed around for a bit and realised that the key names have changed. The attached works whether you call ‘/api/method/uploadfile’ or just ‘/’ with “cmd=uploadfile”.
Any updates on this?, I’m also getting error by using Token Auth. I’m integrating a small api for Node with Token Auth, anyone interested just drop me a line. I’ll be make it available as soon as uploading is working.
Worked for me too with image but when I’m working on video upload and when i encode a mp4 video to base64, and try to upload it using the API, it gives me error
{“exc”:“["Traceback (most recent call last):\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/handler.py\", line 139, in uploadfile\n ret.save()\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 273, in save\n return self._save(*args, **kwargs)\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 296, in _save\n self.insert()\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 223, in insert\n self.run_method(\"before_insert\")\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 797, in run_method\n out = Document.hook(fn)(self, *args, **kwargs)\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1073, in composer\n return composed(self, method, *args, **kwargs)\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 1056, in runner\n add_to_return_value(self, fn(self, *args, **kwargs))\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py\", line 791, in \n fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py\", line 55, in before_insert\n self.save_file(content=self.content, decode=self.decode)\n File \"/home/frappe/frappe-bench/apps/frappe/frappe/core/doctype/file/file.py\", line 455, in save_file\n self.content = base64.b64decode(self.content)\n File \"/home/frappe/frappe-bench/env/lib/python3.6/base64.py\", line 87, in b64decode\n return binascii.a2b_base64(s)\nbinascii.Error: Incorrect padding\n"]”}
Got any solution for permission error? I am facing the same issue when I am trying to upload a file where user don’t have any access token at the moment.