Comments (12)
#21 is now updated and merged, cft. last commit. The Java connector now will set the path property to a ready-to-use URL. On the client side I use at the moment just:
var createPreviewUrl = function(path) { return "/" + path; };
This way I get - if selecting an item, just the correct URL.
If the PR is accepted, I would like to add a configuration key e.g. named previewUrl, which, if true, would just return the server path value (with prefix / i.e. fileRoot), otherwise the default.
from richfilemanager.
Great, thanks.
What is your case with preview url?
-
The idea is to make strict separation of front and back parts, so if your connertor is on server1 and the frontend in on server2 this way (relative path) won't work. So
createPreviewUrl
function is intended to create url like http://site.com?mode="readfile"... to connector and you have to handle it. -
Some previewers aren't work with relative paths, Google Viewer for sure, perhaps Pdf Viewer as well.
So the only right way fot any connector is to implement "readfile" method, which reads file and outputs its content.
from richfilemanager.
I could do this - sorry, I missed this. Preview is now readfile, I have to update the Java Connector.
The case is, that I do not always want to export (select) the proxy url (readfile URL). You could think of it like, that you release this image may be by copying it into a public folder. Then I have not to do always check and restrict access, it´s released.
I have to update the Java Connector to get the two settings working both, the default setting with relative paths in path, and the one I described with direct URL (using document root in config file).
Do you think, it makes sense?
from richfilemanager.
I guess it's a bad idea to use direct urls (relative or absolute) to get image or media files. It leads to the situation when the frontend should expect various results in response and handle each case in a different way. This makes things more complicated. Frontend won't be able to handle cases for each connector. Eventually we will get a mess in the code.
I understand that you may have images in a public folder. That is my case in fact. All files which I have on my local machine and demo page are in a public folder and may be reached by a direct URL. And that's how the FM was arranged before. But, since we decided to bring more standards in FM and make it more unified, I also had to modify PHP connector to handle readfile
request and get rid of direct URLs.
Take the idea that all logic (which file to read and the way to output it) should be perfomed in the readfile
method of your connector.
from richfilemanager.
Hm, I understand. There has been some discussion around this, I assume.
Neverthelesse I´ll update the connector, but try to keep the direct mode, as it is the default for many instances we use - with backward compatibility and URL consistency some reasons behind.
Is this ok?
from richfilemanager.
I would prefer to get rid of direct URL completely. There are no working connectors now except PHP. Java and Node.js are in development now. Any other connectors have to be rewritten and no need in backward compatibility. Let's do in the following way. You implement readfile
method in Java connector in order to make it works in conjuction with the actual version of FM (no direct urls). I will merge it to DEV branch including the changes I'm working on at the moment. After that I don't mind if you come with some elegant solution to handle direct urls, but we have to discuss it at first. So the steps:
- You complete you PR with
readfile
implementations, no direct urls to use - I merge your PR + my changes to DEV branch
- We can discuss if really need direct URLs and the way to implement them (if needed)
from richfilemanager.
Original discussion on standards and unification is in #31 FYI
from richfilemanager.
Hey, thanks! I do my best to separate it. I´ll include just the crude one without direct URL support in the PR, but keep the extended version for later consideration, which then may become another PR.
from richfilemanager.
Yeah, that's great
from richfilemanager.
The code is updated and it´s working apparantly. I kept the (two) methods required for direct URL as dummy indirections, but otherwise removed anything, so it´s much cleaner. If the community comes later up with another solution they could just removed them, without any side effects. This way I can just extend the existing RichFM.java.
from richfilemanager.
Thank you, I am going to merge it up to next week.
from richfilemanager.
Solved with the RichFilemanager release v.2.0.0. Check this post for details.
from richfilemanager.
Related Issues (20)
- how to prevent right click event
- No thumbs HOT 3
- Excel Sheet file view and edit
- No thumbs in laravel project
- Flash file not able to upload HOT 1
- Cannot hook on Rename
- Can we expand all the folder from s3 using single request??? HOT 1
- Copy a folder create 0 byte file in S3
- Failed to resize image (original, thumbnail) on the server
- E_INVALID_PAR_TYPE error while loading HOT 2
- How can I hook into the download action? Is there a callback available?
- RichFilemanger Fails to run under IIS HOT 1
- Use RichFilemanger in .Net Core 3.1 project HOT 1
- Deleted
- Uncaught (in promise) ReferenceError: purl is not defined
- Load other client side configuration manually? (filemanager-config.json) HOT 2
- Preview URL some path items duplicated. HOT 1
- Next/Prev buttons in preview window
- Image broken when preview the uploaded image
- imagesx(): Argument #1 ($image) must be of type GdImage, bool given
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from richfilemanager.