Overwrite a File Manager file
1 min
code examples curl request post \\ \ url https //api archbee com/api/public api/file manager/replace \\ \ header 'accept application/json' \\ \ header 'content type multipart/form data' \\ \ form 'fileid="string"' \\ \ form 'file=@"/path/to/file"'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "multipart/form data"); var formdata = new formdata(); formdata append("fileid", "string"); formdata append("file", fileinput files\[0], "file"); var requestoptions = { method 'post', headers myheaders, body formdata, redirect 'follow' }; fetch("https //api archbee com/api/public api/file manager/replace", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "net/http" url = uri("https //api archbee com/api/public api/file manager/replace") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "multipart/form data" form data = \[\['fileid', file open('undefined')],\['file', file open('/path/to/file')]] request set form form data, 'multipart/form data' response = https request(request) puts response read body import requests url = "https //api archbee com/api/public api/file manager/replace" payload = {} files=\[ ('file',('file',open('/path/to/file','rb'),'application/octet stream')) ] headers = { 'accept' 'application/json', 'content type' 'multipart/form data' } response = requests request("post", url, headers=headers, data=payload, files=files) print(response text) responses // overwrite ok status // invalid request { "status" "not ok", "messages" \[ "some error message" ] }
Have a question?
Our super-smart AI, knowledgeable support team and an awesome community will get you an answer in a flash.
To ask a question or participate in discussions, you'll need to authenticate first.