mod_http_upload-使用Ruby on Rails的HTTP文件上传(XEP-0363) [英] mod_http_upload - HTTP File Upload (XEP-0363) using Ruby on Rails
问题描述
我想在我的聊天应用程序中的用户之间传输图像。我正在使用ejabberd服务器进行聊天。我发现,可以执行此操作的模块是 mod_http_upload
-HTTP文件上传(XEP-0363)。
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.
推荐答案
要使用此模块,请在ejabberd.yml文件中添加配置设置
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"
在此url上上传文件(根据您的设置url) http:// @ HOST @:5443
在ruby on rails上执行。有关模块配置的更多详细信息,请检查此链接-
https://github.com/processone/ejabberd-contrib/blob/master/mod_http_upload/README.txt
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
上传文件后,您可以将链接(url)发送给用户以下载文件。
after uploading file you can send link(url) to user for downloading file.
这篇关于mod_http_upload-使用Ruby on Rails的HTTP文件上传(XEP-0363)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!