Volk65 Posted October 20, 2018 Posted October 20, 2018 Hi! This code works: UniHTMLFrame.URL := UniServerModule.FilesFolderURL+ExtractFileName(FileName); // files/doc1.pdf -- PDF is displayed But this code doesn't work: UniHTMLFrame.URL := '\\ServerName\SharedFolder\SubFolder\doc1.pdf'; // UniHTMLFrame is blank (file exists) How to display a file in a shared folder? Quote
Freeman35 Posted October 20, 2018 Posted October 20, 2018 Hello, in URL link haveto use unix path delimiter "/". "\" this is windows path delimiter. work in just windows native application. Quote
Volk65 Posted October 20, 2018 Author Posted October 20, 2018 This is the first thing I tried - doesn't work. I put a breakpoint and made sure that the path looks like: //.../.../Doc1.pdf-does not work and displays a picture (The site does not allow a connection): Quote
wprins Posted October 20, 2018 Posted October 20, 2018 We had a similar requirement. First of all, understand: URLFrame.URL is basically a way for you to get the browser to ask for a specified URL (file) in a totally standard "http/s" way. So you must think in terms of "URL" not "shared folder" in the first instance. Next, UniGUI's "FilesFolderURL" gives you a way to get a URL to refer to files in a known UniGUI FilesFolder location, via an HTTP/S URL therefore recognized by the UniGUI server. So, thats one way to get UniGUI to do the "translation" from server based path/file location to something that UniGUI will recognize an serve to a client browser. Of course it doesn't help you because you're interested in some other shared location accessible by your server. It follows that since UniGUI doesn't know about this location, you must implement something similar to what UniGUI does for its file/folder location. In short, to solve this we implemented a servermodule event handler/method (sorry I don't have the code in front of me otherwise I'd perhaps be a bit more specific) that basically recognizes special URL's requests (by prefix) and which further along the URL contains a file-id (AES256 encrypted filename/path in fact). The server module then of course decrypts the request and manually/directly serves up the requested file providing the requestor is allowed to do so of course. That's the essence of it anyway. Walter Quote
Volk65 Posted October 20, 2018 Author Posted October 20, 2018 1 hour ago, wprins said: First of all, understand: URLFrame.URL is basically a way for you to get the browser to ask for a specified URL (file) in a totally standard "http/s" way. .... Thanks for the reply. I understand that. Just in the version of UniGUI 1.10.0.1469 this code worked: FileName:= ' \\Server\Folder\File.ext'; FileExists(FileName); -- = True UniSession.SendFile (FileName); -- Worked correctly UniURLFrame.URL:=FileName; -- Worked correctly In version 1.50.0.1480 FileName:= ' \\Server\Folder\File.ext'; FileExists(FileName); -- = True UniSession.SendFile (FileName); -- also works correctly UniURLFrame.URL:=FileName; --- not working anymore I'll rewrite some of the code, of course. And transfer files from one server to another. I want to understand that this is not a bug of UniGUI developers, that now it will be so, that it is normal. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.