简体   繁体   中英

How to configure open-fire server with HttpUploadComponent for offline file transferring?

I use Openfire with Conversations and would like to implement offline file transferring with HttpUploadComponent , I have copied httpupload folder inside openfire folder as below screenshot:

在此处输入图片说明

Then I did below configurations in openfire:

在此处输入图片说明

在此处输入图片说明

I also installed Python and configured config.yml file in httpupload folder like below:

component_jid: upload.192.168.105.164

component_secret: 1234 component_port: 5275

storage_path : ./var/lib/httpupload/

max_file_size: 20971520 #20MiB

http_address: 0.0.0.0 #use 0.0.0.0 if you don't want to use a proxy http_port: 8080

get_url : http://192.168.105.164:8080/

put_url : http://192.168.105.164:8080/

expire_interval: 82800 #time in secs between expiry runs (82800 secs = 23 hours). set to '0' to disable expire_maxage: 2592000 #files older than this (in secs) get deleted by expiry runs (2592000 = 30 days) user_quota_hard: 104857600 #100MiB. set to '0' to disable rejection on uploads over hard quota user_quota_soft: 78643200 #75MiB. set to '0' to disable deletion of old uploads over soft quota an expiry runs allow_web_clients: true #answer OPTIONS requests to allow web clients to upload files

I did run Httpupload server as well :

在此处输入图片说明

After starting python server, if you go openfire\\serversetting\\external components*view the external components* [in the first line], you'll see whether session is created or not:

在此处输入图片说明

在此处输入图片说明

After all of this, when I want to send a file from android client its failling and It gives me this error:

在此处输入图片说明

Where is my problem? Thanks.

In attached error screenshot, the last word is 403, which is indicating that it's related to authorization on HttpUploadComponent end.

Now I started to check the code of this component and on line 83 of https://github.com/siacs/HttpUploadComponent/blob/master/httpupload/server.py it is picking the variable "storage_path" from configuration to place the file in that directory.

Now as mentioned in your question, you have set storage_path : ./var/lib/httpupload/

But you are on a windows machine and this path is invalid.

Try giving a valid windows os path.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM