mod_http_upload - HTTP File Upload (XEP-0363) using Ruby on Rails

守給你的承諾、 提交于 2019-12-21 17:07:20

问题


I want to transfer image between users in my chat application. I am using an ejabberd server for chat. As I found out, the module which could do this is mod_http_upload - HTTP File Upload (XEP-0363).

I am not able to figure out how to implement this. Anybody how could help me in figuring out how to do this will be very helpful.


回答1:


In order to use this module add configuration setting in ejabberd.yml file

listen:
    # add following lines in listen section
    -
      module: ejabberd_http
      port: 5443
      tls: true
      certfile: "/etc/ejabberd/example.com.pem"
      request_handlers:
        "": mod_http_upload

  access:    # add following lines in access section
    soft_upload_quota:
      all: 1000 # MiB
    hard_upload_quota:
      all: 1100 # MiB

  modules:  #add following lines in modules section 
      mod_http_upload:
      docroot: "/home/xmpp/upload"
      put_url: "http://@HOST@:5443"

upload file on this url (according to your setting url) http://@HOST@:5443 as you do in ruby on rails .For more detail about configuration of module check this link- https://github.com/processone/ejabberd-contrib/blob/master/mod_http_upload/README.txt

after uploading file you can send link(url) to user for downloading file.




回答2:


In my case i used https and its worked



来源:https://stackoverflow.com/questions/35578600/mod-http-upload-http-file-upload-xep-0363-using-ruby-on-rails

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!