httpFileUpload plugin is not invoking

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?

    private void handleUpload(File file, ChatRoom room, Message.Type type)
    {
        Log.warning("Uploading file: " + file.getAbsolutePath());
        String fileName = null;
        try {
            fileName = URLEncoder.encode(file.getName(), "UTF-8");
        } catch (UnsupportedEncodingException ignored) {
            // Can be safely ignored because UTF-8 is always supported
        }
        try {
            //UploadRequest request = new UploadRequest(file.getName(), file.length());
            UploadRequest request = new UploadRequest(fileName, file.length());

I have made a pull request based on your suggestion https://github.com/igniterealtime/Spark/pull/423
Will let others to evaluate.

This change has been applied and one can test it in this build https://bamboo.igniterealtime.org/browse/SPARK-NIGHTLY-489/artifact/shared/Install4j-generated-media/ or wait for next day nightly build. Thanks.