upload image to ejabberd by http Post

i am using Rest client of chrome to upload image to ejabberd by method "POST" but ejabberd cant save data of image?i dont know why? please help me
My idea : before upload , convert image to string base64 and after i Post data and ejabberd decode???

It seems I can get them

It seems I can get them through the process/2 function, second parameter is #request. The ugly thing is I had to strip multipart data stuff inserted before the real file content, something like:

Data=--------------------------e3ab5b4e2ee4efaa
Content-Disposition: form-data; name="file"; filename="myfile.jpg"
Content-Type: image/jpeg

...HERE's the real file content...

Easy to get the real data (getting everything after CR+LF) but there must be some ejabberd function for it even if I don't know how it's called...

Syndicate content