问题
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