I use elFinder 2.1.25 with this Java connector: https://github.com/bluejoe2008/elfinder-2.x-servlet
I try to upload some files one by one, for example, A, B and C.
Such behavior was first introduced in commit d5ce45bacadf820401cec288f7421cd3fe154864:
- if (cmd == 'open' || (cmd == 'info' && data.compare)) {
+ if (data.compare && (cmd == 'open' || cmd == 'info')) {
Maybe there were commits fixing this, but I did not found any. In the last release this line is fixed, but the bug is still present.
@ioaoue Is there a problem with Nightly build too? I verified with PHP connector 2.0 and 2.1, but there was no problem. Ask the developer of the Java connector because there is a possibility of a problem with the Java connector. If you find any problems with elFinder's client side program, please let me know as I will fix it.
I tested some versions from 2.1 branch including 2.1.12, 2.1.13, 2.1.20, 2.1.25 and the latest commit. Version 2.1.12 works correctly, and 2.1.13 do not. Then I did git bisect and found that d5ce45b is the first commit with this problem.
I looked at requests from elFinder client to connector and found that on https://studio-42.github.io/elFinder/ every file upload consists of 2 requests: "ls" and then "upload" commands. But on my server only the first file upload looks like that (and the first file uploads correctly). All subsequent uploads conist of 4 requests:
cmd=ls
target=A_L3Rlc3Q_E
intersect[]=1C
cmd=open
reload=1
target=A_L3Rlc3Q_E
tree=1
compare
cmd=ls
target=A_L3Rlc3Q_E
intersect[]=1C
upload
-----------------------------148555191713858134561052379747
Content-Disposition: form-data; name="target"
A_L3Rlc3Q_E
-----------------------------148555191713858134561052379747
Content-Disposition: form-data; name="upload[]"; filename="1C"
Content-Type: application/octet-stream
-----------------------------148555191713858134561052379747
Content-Disposition: form-data; name="mtime[]"
1499745991
-----------------------------148555191713858134561052379747
Content-Disposition: form-data; name="upload_path[]"
A_L3Rlc3Q_E
-----------------------------148555191713858134561052379747
Content-Disposition: form-data; name="dropWith"
0
-----------------------------148555191713858134561052379747--
```
And "open" request lasts much longer than subsequent "ls" and "upload". I think there could be some issue with asynchronous handling of responses.
So I have 2 questions:
Perhaps the result of your connector's ls command is incorrect.
ls command in the preprocessing of the upload and checks the existing item. If the uploading file name is exists in results of ls and CWD does not have that file, elFinder will request the open command and try to keep the CWD up to date.For now elFinder do not send the open command. Only ls, then upload. All works correctly.
If the uploading file name is exists in results of ls and CWD does not have that file, elFinder will request the open command and try to keep the CWD up to date.
For now I do not see this behavior. I tried:
ElFinder client sent only 2 requests: ls and upload.
Did the same test on 2.1.25:
ls requestls responseopen requestls requestls responseupload requestupload responseopen responseWhat data will your connector return to the ls command?
Captured full conversations for 2 cases:
/testNow I see at least one bug in the connector: it seems that it does not understand intersect parameter of the ls command.
The value returned by the ls command should be an object of item name with hash as key ( or array of item names). If intersect is given as a parameter, it is advisable to return only the item names that overlap in the array.
I edited Wiki - https://github.com/Studio-42/elFinder/wiki/Client-Server-API-2.1#ls . Please check out it.
I modified response from connector to match this format. Now ElFinder client works as expected. I think this issue could be closed.
Please update the wiki if there are some other errors in API description.
@ioaoue Thank you for your report. 馃憤
Most helpful comment
I modified response from connector to match this format. Now ElFinder client works as expected. I think this issue could be closed.
Please update the wiki if there are some other errors in API description.