Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[js:core] backward compatibility with API 2.0 is broken #2403

Closed
gordon-matt opened this issue Feb 26, 2018 · 5 comments
Closed

[js:core] backward compatibility with API 2.0 is broken #2403

gordon-matt opened this issue Feb 26, 2018 · 5 comments
Assignees

Comments

@gordon-matt
Copy link
Contributor

gordon-matt commented Feb 26, 2018

I am again working on the .NET Core backend and noticed an annoying issue, which is that the real file paths are not being displayed. I found this link in your wiki: Disable real file path from being shown. The problem is I want the reverse of that and that article is for PHP... and since I did not write the original version of the ELFinder Connector for .NET (which you can find here: https://github.com/leniel/elFinder.Net and I believe the very first version is from here: https://github.com/EvgenNoskov/Elfinder.NET), then I am not 100% certain how to solve this issue. I have been looking at this issue for hours, but can't seem to figure out what the problem is. If I am not mistaken, I just need to make sure that the JSON response has a 'url' property. You can see that it does in the JSON snippet below:

{
   "api":"2.0",
   "netDrivers":[

   ],
   "uplMaxSize":"500K",
   "cwd":{
      "volumeId":"v1_",
      "dirs":0,
      "name":"Files",
      "hash":"v1_RmlsZXM1",
      "mime":"directory",
      "ts":1519452498,
      "size":0,
      "read":1,
      "write":1,
      "locked":0
   },
   "debug":{
      "connector":".net"
   },
   "files":[
      {
         "tmb":"v1_XExpemFyZG1lZXIsIENhbmFkYV8wNkJGMzdFNjQyNUMxMjMzODlDRTc5OUZBRjYyMEZDMS5qcGc1",
         "dim":"1920x1080",
         "phash":"v1_RmlsZXM1",
         "name":"Lizardmeer, Canada.jpg",
         "hash":"v1_XExpemFyZG1lZXIsIENhbmFkYS5qcGc1",
         "mime":"image/jpeg",
         "ts":1519386198,
         "size":385266,
         "read":1,
         "write":1,
         "locked":0
      },
      {
         "tmb":"v1_XE1vdW50YWluc185RDYyMjdFRTk2QTYwNjdGMjZDQTgwRUI3NzdGOEQ2MS5qcGc1",
         "dim":"1920x1080",
         "phash":"v1_RmlsZXM1",
         "name":"Mountains.jpg",
         "hash":"v1_XE1vdW50YWlucy5qcGc1",
         "mime":"image/jpeg",
         "ts":1519386242,
         "size":431323,
         "read":1,
         "write":1,
         "locked":0
      },
      {
         "tmb":"v1_XFdoaWNoUGF0aF85NDkzMTc5NTMzRTBDMENDRUU2OEFGOUREMEM5NDNDMy5qcGc1",
         "dim":"580x526",
         "phash":"v1_RmlsZXM1",
         "name":"WhichPath.jpg",
         "hash":"v1_XFdoaWNoUGF0aC5qcGc1",
         "mime":"image/jpeg",
         "ts":1519395224,
         "size":56601,
         "read":1,
         "write":1,
         "locked":0
      },
      {
         "volumeId":"v1_",
         "dirs":0,
         "name":"Files",
         "hash":"v1_RmlsZXM1",
         "mime":"directory",
         "ts":1519452498,
         "size":0,
         "read":1,
         "write":1,
         "locked":0
      }
   ],
   "options":{
      "archivers":{
         "create":[

         ],
         "extract":[

         ]
      },
      "disabled":[
         "extract",
         "create"
      ],
      "copyOverwrite":1,
      "path":"Files",
      "separator":"/",
      "tmbUrl":"http://localhost:8733/file/thumb/",
      "url":"http://localhost:8733/Files"  // <-- here
   }
}

However, the links are always something like connector.php?cmd=file&target=HASH_TO_FILE_PATH, which I don't want. Can you help?

@nao-pon
Copy link
Member

nao-pon commented Feb 26, 2018

@gordon-matt It seems JSON data is wrong. "volumeId" should be "volumeid".

@nao-pon
Copy link
Member

nao-pon commented Feb 26, 2018

However, since "volumeid" is easy to mistake to "volumeId", I would like to be fixes by the client side.

@nao-pon nao-pon self-assigned this Feb 26, 2018
@nao-pon nao-pon changed the title Want to show real file path [js:core] treat as "volumeid" the "volumeId" of JSON response data Feb 26, 2018
@gordon-matt
Copy link
Contributor Author

gordon-matt commented Feb 26, 2018

I see. Thank you. I believe it might be a change with the JSON serializer in .NET Core compared to previous .NET Framework. So you will change it in a future version to, "volumeId" instead? And what about the other attributes? For example, I have "copyOverwrite" and "tmbUrl". Do they need to be "copyoverwrite" and "tmburl" instead? Can you give me a link to the best place to find all options for your latest JSON structure?

The original version of the .NET Connector was written quite a few years ago.. and I just migrated that code to latest .NET Core and did some refactoring... but if I can get your latest JSON structure and explanation of all properties, I can look at updating the new connector to support everything in the latest elFinder. Thanks in advance.

gordon-matt added a commit to gordon-matt/elFinder.NetCore that referenced this issue Feb 26, 2018
- Create a TinyMCE demo page
- Refactoring
- Changed default theme to "Material - Gray"
@nao-pon
Copy link
Member

nao-pon commented Feb 26, 2018

So you will change it in a future version to, "volumeId" instead?

No, "volumeid" is correct, it will not be changed in the future.

And, there is the Wiki page "Client-Server API 2.1".

@nao-pon nao-pon changed the title [js:core] treat as "volumeid" the "volumeId" of JSON response data [js:core] backward compatibility with API 2.0 is broken Feb 26, 2018
@nao-pon
Copy link
Member

nao-pon commented Feb 26, 2018

OK, again it will only allow "volumeid". However, since backward compatibility to API 2.0 is broken, I will fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants