powered by Jive Software

MIME for HTTP File-Uploads

Hi i try to use openfire in a way that useres can send Images across. That is working reasonably well with clients like Converstions, Xabber and Inverse but not with gajim. In gajim there exists a Plugin, to load the pictures into the chat-Window, but it is not working with openfire. As far as I know this is a problem with openfire not providing the MIME-Type of the file. (Thats what the gajim plugin-developer said) Here is the Thread to the Gajim-Plugin discussion: https://dev.gajim.org/gajim/gajim-plugins/issues/349

can someone help me with how to set uo the openfire-Server in a way that images in gajim are working?

Thanks a lot!
Martin

1 Like

Same problem here. Apreciate some help.

With ‘mime’, you mean the Content-Type header on the response of the HTTP request for the image URL, I suppose?

This appears to work fine for me:

HTTP/1.1 200 OK
Date: Sat, 16 Nov 2019 15:47:18 GMT
Server: Jetty(9.4.18.v20190429)
Strict-Transport-Security: max-age=1209600
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST
Access-Control-Allow-Headers: Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control
Access-Control-Max-Age: 86400
Content-Type: image/jpeg
Cache-Control: max-age=31536000, max-age=86400
Expires: Sun, 17 Nov 2019 15:47:18 GMT
Vary: Accept-Encoding
Content-Encoding: gzip
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked

Look at this one, in my server, pls. It does not show the Content-type on header. May be there some misconfiguration in my server, but I can’t find where to fix it.


https://chat.foxmanager.com.br:7443/httpfileupload/bc60f1cf-1750-4c11-9645-a4d3be04b60d/0.png

Odd! What Operating System and version of Java are you using?

Openfire, Versão: 4.4.4
Ubuntu 18.04.3 LTS
Openjdk 11.0.4 2019-07-16
OpenJDK Runtime Environment (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3)
OpenJDK 64-Bit Server VM (build 11.0.4+11-post-Ubuntu-1ubuntu218.04.3, mixed mod e, sharing)

Moments ago, I’ve released version 1.1.3 of the HTTP File Upload plugin for Openfire, which should resolve this issue. Care to give that a try?

Hello Guus. Tks for the update. Same issue. No content-type yet.
https://chat.foxmanager.com.br:7443/httpfileupload/2f4594f7-d5b3-4c3c-8220-c1b064164c09/0.png

Can you please enable debug logging, and copy/paste the logs related to the retrieval of a file?

Here you are:
2019.11.18 16:24:08 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_SENT to session 25
Queue : [MESSAGE_SENT, ]

2019.11.18 16:24:09 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_RECEIVED to session 25
Queue : [MESSAGE_RECEIVED, ]

2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslFilter - Session Server25: Message received : HeapBuffer[pos=0 lim=64 cap=512: 17 03 03 00 3B 00 00 00 00 00 00 00 4F B6 0A D0…]
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslHandler - Session Server25 Processing the received message
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslFilter - Session Server25: Processing the SSL Data
2019.11.18 16:24:09 org.apache.mina.filter.codec.ProtocolCodecFilter - Processing a MESSAGE_RECEIVED for session 25
2019.11.18 16:24:09 class org.jivesoftware.openfire.streammanagement.StreamManager[189.91.61.186] - Received acknowledgement from client: h=2323
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslFilter - Session Server5: Message received : HeapBuffer[pos=0 lim=49 cap=512: 17 03 03 00 2C 20 E4 4E 98 16 53 F6 04 42 92 3C…]
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslHandler - Session Server5 Processing the received message
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslFilter - Session Server5: Processing the SSL Data
2019.11.18 16:24:09 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_RECEIVED to session 5
Queue : [MESSAGE_RECEIVED, ]

2019.11.18 16:24:09 org.apache.mina.filter.codec.ProtocolCodecFilter - Processing a MESSAGE_RECEIVED for session 5
2019.11.18 16:24:09 org.apache.mina.filter.ssl.SslFilter - Session Server5: Writing Message : WriteRequest: HeapBuffer[pos=0 lim=34 cap=64: 3C 61 20 78 6D 6C 6E 73 3D 27 75 72 6E 3A 78 6D…]
2019.11.18 16:24:09 org.apache.mina.filter.executor.OrderedThreadPoolExecutor - Adding event MESSAGE_SENT to session 5
Queue : [MESSAGE_SENT, ]

2019.11.18 16:24:09 org.jivesoftware.openfire.http.HttpSession - complete event org.eclipse.jetty.server.AsyncContextEvent@280cd3bc for 18531321 in session gxh05q55b
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ does exist in repository.
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file content…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on system installed file type detectors…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file name…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ content type: null
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ size: 20694 bytes
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.Servlet - … setting content length ‘20694’.
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ ETag value: -1390542675
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.Servlet - … setting ETag ‘-1390542675’.
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ does exist in repository.
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file content…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on system installed file type detectors…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file name…
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ content type: null
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ size: 20694 bytes
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.Servlet - … setting content length ‘20694’.
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ ETag value: -1390542675
2019.11.18 16:24:09 nl.goodbytes.xmpp.xep0363.Servlet - … setting ETag ‘-1390542675’.
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ does exist in repository.
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file content…
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on system installed file type detectors…
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ Probing content type based on file name…
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ content type: null
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ size: 20694 bytes
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.Servlet - … setting content length ‘20694’.
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.repository.AbstractFileSystemRepository - UUID ‘77ed911c-98c8-4cb9-a053-0a3ba8ff5344’ ETag value: -1390542675
2019.11.18 16:24:10 nl.goodbytes.xmpp.xep0363.Servlet - … setting ETag ‘-1390542675’.

Hello.
I have the same problem - no Content-Type in header for http upload images.
Any updates on this issue?

HTTP File Upload Plugin version = 1.1.3
Openfire version = 4.5.1