powered by Jive Software

httpFileUpload plugin is not invoking

Hi,
I want to implement httpfileupload plugin and check about file store in temp folder on transfer. Then I have to customize component to change storage place. As googled, I deployed httpFileUpload plugin in admin console by using plugin option and tried in plugin folder directly also. While doing deployment, initialization is happening (initializePlugin() method invoked). As mentioned httpfileupload readme link, “While exchanging files, the plugin by default stores the files that are being transferred in a temporary directory” (https://www.igniterealtime.org/projects/openfire/plugins/httpfileupload/readme.html). But it is not creating any folder or file in temp folder by default, while transferring files in spark. I put log.info in httpfileupload component and analyzed. But there is no logs printed, while transferring the file.
I tried by hitting component URL, which was created in initializePlugin(). It shows “HTTP ERROR 404” with Reason : Not found. Now, a folder created in temp folder; and I can able to see statements of CORSServlet in log file. But still, there is no files stored in temp folder, while transferring file.
Is there any extra configurations need to implement, while installing this plugin? Kindly help me on this.

What OS, which version of Openfire and HttpUpload Plugin? I have just tried with 1.1.0 version of plugin and Spark and it didn’t work. There was some change in that plugin, that made Spark’s plugin incompatible. But it works for me if i use 1.0.0 version of that plugin (with Openfire 4.2.2). Though i saw someone uploading images into Open Chat on this site with Conversations. And the server on this site runs latest code all the time (so it must be 4.2.3 with 1.1.0 plugin). I suppose Conversations client works out of the box.

If you want to test it with 1.0.0 version, then i will attach it herehttpfileupload 1.0.0.jar (2.0 MB)

Temporary folder is either created in C:\Windows\Temp if Openfire is running with SYSTEM permissions (as a service) or in the user’s AppData\Local\Temp folder (the user running Openfire). The folder name is e.g. xmppfileupload7063003525592036815. That’s on Windows. Have no clue where it creates such folder on other OS.

Have created a ticket for Spark https://issues.igniterealtime.org/browse/SPARK-2056

Hi Wroot, Thanks for your immediate reply. I tested in both Windows OS and Linux. Operfire version is 4.2.1. HttpUpload Plugin version is 1.1.0. Spark version is 2.8.3. I have downloaded and tried with mentioned version 1.0.0. Still, facing the same issue.
Can you please, provide the deployment steps in detail? So that, I can check if anything missed from my side.

You have to use unreleased 2.9.0 version of Spark for this. 2.8.3 doesn’t have a plugin for httpfileupload. https://www.igniterealtime.org/downloads/nightly_spark.jsp Or any other client that supports this feature, like Conversations on Android.

Though i wonder, maybe it will even work if you just take fileupload.jar plugin from 2.9.0 and put it into 2.8.3. Haven’t tested myself.

No, it doesn’t work with 2.8.3. There probably were some changes in Spark itself to support this. So, only with 2.9.0.

Hi Wroot,
Thanks for your reply. I downloaded files from mentioned link (spark_2_9_0-20180318, spark_2_9_0-20180319, spark_2_9_0-20180320). My laptop OS is Windows 10, 64 bit. But, downloaded files support 32 bit OS. Can you please share the link of downloads, which supports 64 bit OS?

There is no separate 64-bit version of Spark. 32-bit versions work on 64-bit OS.

Hi Wroot,
We are getting unable to install spark latest version. We are facing “The install4j wizard could not find a Java™ Runtime Environment on your system. Please locate a suitable 32-bit JRE.(minimum version: 1.8)” error message. Kindly help us on this.

Spark needs 32-bit Java of 8 version (it won’t work with 64-bit or Java 9 version). You should download the file with “with-jre” in its name. It will have Java inside, so you won’t have to install Java on your system additionally.

hi,

plugin v1.0.0 works with spark 2.9.0 only for 1st upload, then it stops working (same behavior as with newer plugin)

You are right. And there is a patch proposed to fix that https://github.com/igniterealtime/Spark/pull/418
Once it is merged, Dele should release next version of plugin for Spark, hopefully.

I have just merged this patch. Now it works with the latest HTTP File Upload plugin on Openfire and it works more than once. The fix will be available in tomorrow’s nightly build (03.27) or you can grab it here https://bamboo.igniterealtime.org/browse/SPARK-NIGHTLY-478/artifact/shared/Install4j-generated-media/

yes, it works now. but “View conversation history” button is missing (and also no history shows up)

Do you mean it has disappered in this last build or was it the same with other 2.9.0 builds? Also, do you have Client Control plugin installed on Openfire? Try updating it to the latest version, then also check Client Management menu in Admin Console and check if History is not disabled there.

yes, you are right. “History Transcripts” option was disabled in Client Features

file names should be URL encoded/escaped otherwise put request fails when file name contains spaces (and possibly other characters)

(fixed it by myself in ChatRoomDecorator.java using java.net.URLEncoder.encode for now…)

Thanks. I have filed a ticket https://issues.igniterealtime.org/browse/SPARK-2059

milo, can you tell what line exactly have you modified?