Hyperlink

195 views
Skip to first unread message

Johnny Pedersen

unread,
Mar 11, 2024, 4:01:03 PM3/11/24
to Jam.py Users Mailing List
I am migrating from a MS Access app to jam-py. In access, there is a database field "hyperlink". I use it to open folders in a local network. How can I open windows explorer from a jam-py app?

vsan...@gmail.com

unread,
Mar 11, 2024, 4:41:23 PM3/11/24
to jam...@googlegroups.com
I think it's strange for a web page to open a folder on the user's computer. However, have you tried using something like:
<html>
<body>
<a href="file:///Users/">Home</a>
</body>
</html>

I don't have any Windows computer to test on. But you can change "file:///Users/" to "file://c/" or something like that. The important thing is to start with "file://"

But I really think you should reconsider the idea of opening a folder on the user's computer. Or perhaps you could explain why you want to do this and there is a more suitable solution.
> --
> You received this message because you are subscribed to the Google
> Groups "Jam.py Users Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jam-py+un...@googlegroups.com
> <mailto:jam-py+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jam-py/7565546a-82e5-4edb-8bd7-08cc84c20ea4n%40googlegroups.com <https://groups.google.com/d/msgid/jam-py/7565546a-82e5-4edb-8bd7-08cc84c20ea4n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>

Johnny Pedersen

unread,
Mar 11, 2024, 7:39:03 PM3/11/24
to Jam.py Users Mailing List
In this case, it is not strange at all. For each customer, there is a local network folder that contains files that are worked with in various applications that cannot be run in any browser.

The example you gave doesn't work. Somehow I have to get windows explorer to open. Maybe via some shell command? Some .js script perhaps? There is a database type "FILE" that opens the explorer. I want the explorer to open in the same way, but then only open the folder it points to.

Dean D. Babic

unread,
Mar 11, 2024, 9:53:53 PM3/11/24
to Jam.py Users Mailing List
Hmm,

It is not a link you are after, correct? Because the link opens a file. You are after placing the file into the location I think. And then having a link.

The reason why customers do not move from Access is exactly this - they expect the same functionality from the Web App to 
interact with the Desktop.
But the Web App is contained!  For good reasons. The Web app should never access the File system outside the Container.
The Web App does not know if is a Local network or a WWW. All the same.

Hence, I would use what the Web App supports, file upload and download. Not the Explorer, no. There is no Explorer in the Web App container, 
and App does not know what file:///Users/ is, if that is outside the container operating boundaries. The browser on local machine will always display 
the local files.
Even if is inside the boundaries, the Users is normally controlled with Users privileges to read/write from Active Directory or locally. And Web 
app should be separate from them, with different privileges.

Simply put, there is a need to operate within the WWW boundaries, meaning using FTP or file upload/download by the app.

Johnny Pedersen

unread,
Mar 12, 2024, 9:36:51 AM3/12/24
to Dean D. Babic, Jam.py Users Mailing List
Hmm,

It is not a link you are after, correct? Because the link opens a file. You are after placing the file into the location I think. And then having a link.


It is a link to a folder, or whatever. It is called "hyperlink" in ms access. It is pointing to local network folders, not specific files. As it is now in the jam-app, I have to manually open windows explorer (or the equivalent in linux) and then copy/paste into explorer.
 
The reason why customers do not move from Access is exactly this - they expect the same functionality from the Web App to 
interact with the Desktop.
But the Web App is contained!  For good reasons. The Web app should never access the File system outside the Container.
The Web App does not know if is a Local network or a WWW. All the same.

I understand that this is the usual/normal situation. But in my case it is necessary to have this feature. And I really hope it's doable somehow. I really do not see any other way to do it. 

Hence, I would use what the Web App supports, file upload and download. Not the Explorer, no. There is no Explorer in the Web App container, 

There is no need for an in-app explorer. I just simply need a way to open the O/S explorer. 
 
Simply put, there is a need to operate within the WWW boundaries, meaning using FTP or file upload/download by the app.

It is unfortunately not usable in my case. It would be way too much hassle to download and upload local files all the time that way, instead of working directly with the files in the actual folder.

Johnny

Dean D. Babic

unread,
Mar 12, 2024, 10:26:48 AM3/12/24
to Jam.py Users Mailing List
Do you mean opening Explorer to the EXACT location somehow linked to some DB field because there are the files?
So lets say you have 200 clients with different folders and there is a need to open the exact folder you specified in the DB for each client?

To answer, yes, it is possible to have something like this:

Valmir Santana

unread,
Mar 12, 2024, 10:29:38 AM3/12/24
to Jam.py Users Mailing List

As I know, web browsers can't open programs on user PC. This is not a Jam.py limitation. It's a web browser limitation (due security issues). As I recall, only Internet Explorer, via ActiveX.

Maybe if you use Electron(https://www.electronjs.org/) to run your webapp, you could do that.


Em 12/03/24 10:36, Johnny Pedersen escreveu:
--
You received this message because you are subscribed to the Google Groups "Jam.py Users Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jam-py+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jam-py/CADj02sXWeVu-L1gPsEZ1MZ3ALyBfaRjE-DOQSKt0C_HV3cpOGg%40mail.gmail.com.

Danijel Kaurin

unread,
Mar 12, 2024, 1:45:25 PM3/12/24
to Valmir Santana, Jam.py Users Mailing List
Hi Valmir.

Can you describe what you want to achieve with this functionality with a plastic example? I also come from the MS Access world and have been developing web applications on Jam.py for about 3 years now.

Regards

Danijel

Dean D. Babic

unread,
Mar 12, 2024, 11:44:37 PM3/12/24
to Jam.py Users Mailing List
Hi  Valmir, 

folder.mp4

Dean D. Babic

unread,
Mar 13, 2024, 12:15:34 AM3/13/24
to Jam.py Users Mailing List
I added the same to:


and of course, nothing happens. The Server error is:
024-03-13 04:06:54 #033[93m#033[44mGetting file://localhost/tmp

This confirms that Johnny wont be able to access anything outside the local PC, which is not the idea for the Web app.
However, what can  be done here AFTER the files are copied from local PC to the folder is:

- run server code to ADD/REMOVE files for each customer, if needed after copying. The logic should be developed, etc.

Only then the files will be available over the Web, which is the whole point. 

Hope this helps

Dean D. Babic

unread,
Mar 13, 2024, 5:37:46 AM3/13/24
to Jam.py Users Mailing List
Here you go, on Windows and v5:

Folder.mp4

Johnny Pedersen

unread,
Mar 13, 2024, 9:07:40 AM3/13/24
to Dean D. Babic, Jam.py Users Mailing List
Yes, that is exactly what I want. But in my case it is the 'tasks' instead of the clients that should be linked to the folder location. But the principle is the same. Perfect.

Johnny Pedersen

unread,
Mar 13, 2024, 4:03:03 PM3/13/24
to Jam.py Users Mailing List
Sorry, I didn't think. The above is exactly what I want, but of course it won't work on the client computers because the app is on the server on the local network.
 

Johnny Pedersen

unread,
Mar 13, 2024, 6:31:19 PM3/13/24
to Jam.py Users Mailing List
I got it working with MicroSoft Edge running IE11 and ActiveX. A slightly modified script is used. Dangerous? No, because it is only running in the local network. But i have to think about a future solution. I don't want to go back to ms access. 

vsan...@gmail.com

unread,
Mar 13, 2024, 6:51:02 PM3/13/24
to jam...@googlegroups.com
Johnny,

As I early said, ActiveX is the only way that I know to do that.
I'm happy that you found a solution!

--
Valmir

On 3/13/24 7:31 PM, Johnny Pedersen <jp.ly...@gmail.com> wrote:
> I got it working with MicroSoft Edge running IE11 and ActiveX. A
> slightly modified script is used. Dangerous? No, because it is only
> running in the local network. But i have to think about a future
> solution. I don't want to go back to ms access.
>
> On Wednesday 13 March 2024 at 21:03:03 UTC+1 Johnny Pedersen wrote:
>
> Do you mean opening Explorer to the EXACT location somehow
> linked to some DB field because there are the files?
> So lets say you have 200 clients with different folders and
> there is a need to open the exact folder you specified in
> the DB for each client?
>
> To answer, yes, it is possible to have something like this:
> https://stackoverflow.com/questions/47812372/python-how-to-open-a-folder-on-windows-explorerpython-3-6-2-windows-10 <https://stackoverflow.com/questions/47812372/python-how-to-open-a-folder-on-windows-explorerpython-3-6-2-windows-10>
>
>
> Yes, that is exactly what I want. But in my case it is the
> 'tasks' instead of the clients that should be linked to the
> folder location. But the principle is the same. Perfect.
>
>
> Sorry, I didn't think. The above is exactly what I want, but of
> course it won't work on the client computers because the app is on
> the server on the local network.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Jam.py Users Mailing List" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to jam-py+un...@googlegroups.com
> <mailto:jam-py+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jam-py/4fe8c290-a837-412d-bacd-1f8f3f5631a9n%40googlegroups.com <https://groups.google.com/d/msgid/jam-py/4fe8c290-a837-412d-bacd-1f8f3f5631a9n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>

Dean D. Babic

unread,
Mar 13, 2024, 9:55:56 PM3/13/24
to Jam.py Users Mailing List
It is dangerous because the Web server, particularly the built-in development server (which is not Jam, but Python),
can be taken over by the malicious script. And then the World is their oyster...
If the browser is not particularly updated, or visiting a lot of dodgy sites, a trojan might be picked up.

One solution might be to upload a zip file via Jam. Then a button might unzip the file and create DB file records for a particular xyz record.
For Jam to serve this files, all must be created in /static folder.

It can't be just any path. Even /static path is problematic for the Web servers, ie Apache. Because Apache has a virtual path, a container,
so depending how Apache is configured it might or might not serve files properly.

So if anyone wants to create a proof of concept, the folders must reside in /static/files/xyz, where xyz represents the DB record.
Plus logic, like what happens if overwriting the files? What happens if xyz is deleted (like Customer or task is deleted)? Are files deleted? Etc.

The solution would put Jam shoulder to shoulder with Access. It would be a massive win, and finally ie Law offices in the US might look at Jam.
Which they don't, since Access is the King there.

Dean D. Babic

unread,
Mar 14, 2024, 12:50:38 AM3/14/24
to Jam.py Users Mailing List
Here is also an idea:

- upload the files to Google drive! With OAuth, one can login to Google and automatically access the drive.
Then, grant access to customers for a specific folder on Google drive, and have THAT as a hyperlink!
Since users are already authenticated, off they go...

Here is the example! Try it, you'll be presented with "You need access" - which is exactly what is needed!

Johnny Pedersen

unread,
Mar 14, 2024, 6:37:30 AM3/14/24
to Jam.py Users Mailing List

It is dangerous because the Web server, particularly the built-in development server (which is not Jam, but Python),
can be taken over by the malicious script. And then the World is their oyster...
If the browser is not particularly updated, or visiting a lot of dodgy sites, a trojan might be picked up.

The browser is not allowed to connect to the internet. It is blocked by the firewall. The only allowed connection is to the server's IP address. This should make it pretty safe. I really have no other options yet, except to revert back to ms access. Which I not wish to do.
 
One solution might be to upload a zip file via Jam. Then a button might unzip the file and create DB file records for a particular xyz record.
For Jam to serve this files, all must be created in /static folder.

For some this could be a solution. But not in my case.
 
It can't be just any path. Even /static path is problematic for the Web servers, ie Apache. Because Apache has a virtual path, a container,
so depending how Apache is configured it might or might not serve files properly.

So if anyone wants to create a proof of concept, the folders must reside in /static/files/xyz, where xyz represents the DB record.
Plus logic, like what happens if overwriting the files? What happens if xyz is deleted (like Customer or task is deleted)? Are files deleted? Etc.

The solution would put Jam shoulder to shoulder with Access. It would be a massive win, and finally ie Law offices in the US might look at Jam.
Which they don't, since Access is the King there.

Yes really a massive win.

Johnny Pedersen

unread,
Mar 14, 2024, 6:41:16 AM3/14/24
to Jam.py Users Mailing List
As I early said, ActiveX is the only way that I know to do that.
I'm happy that you found a solution!

Thank you. With some extra security measures, it is an acceptable solution at the moment.
 

Johnny Pedersen

unread,
Mar 14, 2024, 6:49:56 AM3/14/24
to Jam.py Users Mailing List
Nice idea and a great solution that for sure could be usable. But unfortunately not in my case.  Need to have all files on the local server. 

Johnny Pedersen

unread,
Mar 14, 2024, 6:55:45 AM3/14/24
to Jam.py Users Mailing List

As I know, web browsers can't open programs on user PC. This is not a Jam.py limitation. It's a web browser limitation (due security issues). As I recall, only Internet Explorer, via ActiveX.

Maybe if you use Electron(https://www.electronjs.org/) to run your webapp, you could do that.


Seems interesting. After all, it was possible to fly to the moon already 55 years ago. Of course, it must somehow be possible to combine the best of 2 worlds.

 
Message has been deleted

Johnny Pedersen

unread,
Mar 30, 2024, 7:13:45 AM3/30/24
to Jam.py Users Mailing List
Thanks for the tip for Electron! I have managed to build a front end for my jam.py app. So now I no longer need to use ActiveX :)

My Electron-browser is very lightweight and has for example no address field. It looks like a regular app and not a browser.
Reply all
Reply to author
Forward
0 new messages