RichFilemanager icon indicating copy to clipboard operation
RichFilemanager copied to clipboard

Unable to upload file in java

Open u4bharat opened this issue 5 years ago • 9 comments

In raising this issue, I confirm the following (please check boxes):

  • I have read and understood the Wiki. Especially deploy and configuration articles.
  • I have checked that the bug I am reporting can be replicated, or that the feature I am suggesting isn't already present.
  • I have checked the pull requests tab for existing solutions/implementations to my issue/suggestion.
  • I realise that server-side connectors are provided by various contributors. The implementations are vary due to programming language features/limitations or other factors. Thus a particular connector may not implement, or partially implement, the API features.
  • I realise that any changes in configuration options and/or plugin parameters affect the plugin behavior. I specified all the differences from defaults in details.

I use the following server-side connector (check one):

  • [ ] PHP connector by servocoder
  • Java connector by fabriceci
  • [ ] Python3 Flask connector by jsooter
  • [ ] Python3 Flask connector by stevelittlefish
  • [ ] NodeJs connector by jlaustill and forestlake
  • [ ] ASP.NET Core connector by sinanbozkus
  • [ ] ASHX connector by richeflits
  • [ ] Other (specified below)

My familiarity with the project is as follows (check one):

  • [ ] I have never used the project.
  • [ ] I have used the project briefly.
  • I have used the project extensively, but have not contributed previously.
  • [ ] I am an active contributor to the project.

I'm Using Rich file manager in my web application but I'm not upload any files in it. The version which i'm using for rich file manager is 2.5.1. The web app is developed in Spring MVC. However, even if I hover my mouse on it, no information shows, only a red, blank diaglog. dsaasd And chrome console gives the following error: image

Any help would be greatly appreciated. Thanks in advance.

u4bharat avatar Dec 12 '18 06:12 u4bharat

Addressing your question to @fabriceci If he is not available you can try to fix it by yourself and provide a PR

psolom avatar Dec 12 '18 18:12 psolom

I have a repository for the connector. Could you open an issue with the maximum of details?

I also have 2 questions:

  • Have you read the wiki (java repository)?
  • Do you fulfill the requirement (java >=7 & servlet API >= 3.1) ?

fabriceci avatar Dec 17 '18 08:12 fabriceci

Thanks for your reply. Yes I have read wiki (java repository), and I also found few changes which were corrected in the filemanager.config.properties, which are shown below. image

image

However, the environment requirements(i.e Java>7 and servlet API >=3.1) are met. If you require more details kindly let me know. Looking forward to hear from you.

u4bharat avatar Dec 18 '18 08:12 u4bharat

I created a demo project with SPRING MVC here. To avoid Java/Spring configuration issues, could you try this demo project and tell me if the bug occurs? If yes, could you give me a way to reproduce the issue?

fabriceci avatar Dec 19 '18 12:12 fabriceci

Hello fabriceci, Thanks for the demo application and spending your precious time. The demo application works very well. But unfortunately, when we implement the same configuration to our project which is built using Spring and maven project structure, we aren't able to upload files.The changes which we made were, we added similar code in our controller present in the demo controller provided by you, we also added maven dependency for rich filemanager in pom.xml . The change reflected in project is the User interface only. Below I have attached screenshot of the problem. image

If you require more details kindly let me know. Looking forward to hear from you.

u4bharat avatar Dec 24 '18 09:12 u4bharat

Unfortunately, if there is no error in the demo project, it's probably a Spring config issue.

fabriceci avatar Jan 21 '19 15:01 fabriceci

Hello fabriceci, Thanks for reply. As we have changed all Spring configuration in our project but unfortunately result is same.

Change in filemanager.config.json
 "api": {
    "lang": "java",
    "connectorUrl": "/test/admin/fileManager/api",
    "requestParams": {
        "GET": {},
        "POST": {},
        "MIXED": {}
    }
},

"viewer": {
    "absolutePath": false,
},

Change in filemanager.init.js

$('.fm-container').richFilemanager({
    baseUrl: '/test/RichFilemanager-master',
    });

Also we have added dependency for jitpack.

<dependency>
	<groupId>com.github.fabriceci</groupId>
	<artifactId>RichFilemanager-JAVA</artifactId>
	<version>master-SNAPSHOT</version>
</dependency>

<repositories>
	<repository>
	    <id>jitpack.io</id>
	    <url>https://jitpack.io</url>
	</repository>
</repositories>

But still we are facing issue in file upload functionality.
The demo that you provided is in gradle but out project is in 

maven so there may be a change in configuration. If possible then can you provide demo with Spring/MVC and maven.

u4bharat avatar Jan 24 '19 12:01 u4bharat

Hello @fabriceci , Looking further in the issue, I found out following things:

  1. At the time of file upload in filemanager.min.js the control abruptly moves out from the function fileuploadprogressall, while in the demo which you provided the the control proceeds from fileuploadprogressall to fileuploaddone and the file gets uploaded in the demo. In my case the control goes away from fileuploadprogressall. On chrome console i also tried to see the difference between the values variable 'b' used in fileuploadprogressall, but didn't found any conflicting difference.
  2. My folder of rich file manager is in webapp/RichFilemanager-master folder, unlike in your demo it's in resource/static/ folder, so if Richfilemanager is on different folder does it makes any difference?
  3. I have checked the properties by debugging LocalFileManager.class the are exactly same as of your demo. Any help would be greatly appreciated. Hoping a positive response from your side.

u4bharat avatar Jan 31 '19 11:01 u4bharat

Hello @u4bharat ,

Maybe you already solved your issue.

  1. The JAVA API is completely independent of the JS logic, the api work only with REST calls from the client.
  2. If you set the config file correctly, no.

You should check the config files from the demo (JS and Java side), unfortunately I can't help you more.

fabriceci avatar Feb 08 '19 10:02 fabriceci