Mod_http_upload - HTTP File Upload (XEP-0363) using SMACK

https://stackoverflow.com/questions/51856785/mod-http-upload-http-file-upload-xep-0363-using-smack

ejabberd debug…

Here the ejabberd error
#iq{id = <<“1TNIF-33”>>,type = get,lang = <<“en”>>,
from =
#jid{
user = <<“mamun”>>,server = <<“localhost”>>,
resource = <<“130055862109590748621314”>>,luser = <<“mamun”>>,
lserver = <<“localhost”>>,
lresource = <<“130055862109590748621314”>>},
to =
#jid{
user = <<>>,server = <<“upload.localhost”>>,resource = <<>>,
luser = <<>>,lserver = <<“upload.localhost”>>,lresource = <<>>},
sub_els =
[#xmlel{
name = <<“request”>>,
attrs = [{<<“xmlns”>>,<<“urn:xmpp:http:upload:0”>>}],
children =
[#xmlel{
name = <<“filename”>>,attrs = [],
children = [{xmlcdata,<<“img.jpg”>>}]},
#xmlel{
name = <<“size”>>,attrs = [],
children = [{xmlcdata,<<“19691”>>}]},
#xmlel{
name = <<“content-type”>>,attrs = [],
children =
[{xmlcdata,<<“application/octet-stream”>>}]}]}],
meta = #{ip => {192,168,1,5}}}
2018-08-15 21:52:17.204 [debug] <0.495.0>@ejabberd_router:do_route:352 route:
#iq{id = <<“1TNIF-33”>>,type = error,lang = <<“en”>>,
from =
#jid{
user = <<>>,server = <<“upload.localhost”>>,resource = <<>>,
luser = <<>>,lserver = <<“upload.localhost”>>,lresource = <<>>},
to =
#jid{
user = <<“mamun”>>,server = <<“localhost”>>,
resource = <<“130055862109590748621314”>>,luser = <<“mamun”>>,
lserver = <<“localhost”>>,
lresource = <<“130055862109590748621314”>>},
sub_els =
[#xmlel{
name = <<“request”>>,
attrs = [{<<“xmlns”>>,<<“urn:xmpp:http:upload:0”>>}],
children =
[#xmlel{
name = <<“filename”>>,attrs = [],
children = [{xmlcdata,<<“img.jpg”>>}]},
#xmlel{
name = <<“size”>>,attrs = [],
children = [{xmlcdata,<<“19691”>>}]},
#xmlel{
name = <<“content-type”>>,attrs = [],
children =
[{xmlcdata,<<“application/octet-stream”>>}]}]},
#stanza_error{
type = modify,code = 400,by = <<>>,reason = ‘bad-request’,
text =
[#text{
lang = <<“en”>>,
data =
<<“Missing attribute ‘filename’ in tag qualified by namespace ‘urn:xmpp:http:upload:0’”>>}],
sub_els = []}],
meta = #{ip => {192,168,1,5}}}

1 Like

your issue has been resolved in Smack 4.2.1.
Upgrading should fix your issue (Smack 4.3 has just been released :wink:)