How to upload files on ejabberd server?

Viewed 754

I followed the documentation to and viewed multiple links to learn how to upload a file on the ejabberd server but still cannot upload files on the ejabberd server. My motive is to upload a file from android application before that I tried with the postman. I am using the default ejabberd configuration with a slite change by making tls false to use http not https.

hosts:
  - "faiqkhan-VirtualBox"

listen:
  -
    port: 5443
    ip: "::"
    module: ejabberd_http
    tls: false
    request_handlers:
      "/upload": mod_http_upload

modules:
  mod_http_upload:
    put_url: "http://@HOST@:5443/upload"

I am using like this: http://faiqkhan-VirtualBox:5443/api/mod_http_upload but getting 400 bad requests Did I miss something? Or do the whole thing wrong?

1 Answers

The configuration is correct but your URL is incorrect format.

 http://yourservername:5443/upload/
 or 
 https://yourservername:5443/upload/

in your case it will be,

http://faiqkhan-VirtualBox:5443/upload/



 

You should get 'Not found. from the server

/upload is the url parameter which is been specified in your mod_http_upload module configuration

mod_http_upload is the module that handle http file transfer or https file transfer if certificate is config

hope this is helpful

Related