What is the preferable way to for sending file (image/video) with xmpp stanza?

I kept searching for the solution for sending and receiving file through XMPP on INTERNET and and asked a qustion on Quora also as per the answer given by Simon Tennant on this http://www.quora.com/What-is-better-way-sending-file-with-ejabberd-or-se...

Think of XMPP as a signalling system: as such you really don't want to be sending files inside XMPP messages.

At the same time HTTP is optimised for file delivery and XMPP can assure you that the requester is really who they say they are.

Putting the two together (XMPP request + token to retrieve the file + endpoint) and http for actually grabbing the file, you have a nice way to retrieve files.

AS per answers Simon Tennant from this http://www.quora.com/What-is-better-way-sending-file-with-ejabberd-or-se... and Mickaël from this http://stackoverflow.com/questions/2981459/can-ejabberd-support-offline-... i came two a conclusion that I have to flow for image sharing

Flow1
As shown in below image one have to use one dedicated media server(http server) to handle image/video file.Normal text messages will be send using XMPP while image will be send to media server and a signal will be send [which contain token] using xmpp.

http://i.stack.imgur.com/xoOP3.jpg

As per Alex answer given on this http://forum.ag-software.net/thread/995-XMPP-Packet-size one can manually set xmpp stanza size by changing "max_stanza_size" in ejabberd.
http://i.stack.imgur.com/1gpMB.jpg

{5222, ejabberd_c2s, [ {certfile, "D:\var\ejabberd\certs\AG-SoftwareXMPP Components and Competence " AG-Software.pem"}, starttls, {access, c2s}, {shaper, c2s_shaper}, {max_stanza_size, 65536} ]}

Flow2Then one can use XMPP stanza to send image(base64) string as shown in below image

Note :: if my understanding is wrong then any correction in operation of flow1 and flow2 will be really helpful
My questions are as below

1>>.From my research I found that flow1 is more popular then flow2, can someone help me to understand what are the rezones behind it?

2>>.One can have control on xmpp stanza size ,then what are the server side(ejabberd)complication while passing a large file[as per example 2 mb] from one client to another client?

Any clarity on above question will be really helpful!!!
Thank you !!!!!

What is the preferable way to

Hi devlad,
Which flow did you use finally ? I'm looking for the best solution for sending and receiving file through XMPP.
Can you post an update on your experience ?
Thanks.

What is the preferable way to

Sending file through XMPP canonical approach is:
1. Negotiation through XMPP
2. Sending the file out of band through the negotiated approach.

Syndicate content