psolom / RichFilemanager

An open-source file manager. Up-to-date for PHP, Java, ASHX, ASP, NodeJs & Python 3 Flask. Contributions are welcome!
http://fm.devale.pro
906 stars 251 forks source link

Unable to upload file in java #364

Open u4bharat opened 5 years ago

u4bharat commented 5 years ago

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

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

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


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.

psolom commented 5 years ago

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

fabriceci commented 5 years ago

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

I also have 2 questions:

u4bharat commented 5 years ago

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.

fabriceci commented 5 years ago

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?

u4bharat commented 5 years ago

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.

fabriceci commented 5 years ago

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

u4bharat commented 5 years ago

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 commented 5 years ago

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.
fabriceci commented 5 years ago

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.