NetTalk Central

Author Topic: Desktop File path  (Read 3825 times)

Richard I

  • Sr. Member
  • ****
  • Posts: 398
    • View Profile
    • Email
Desktop File path
« on: May 28, 2024, 09:17:52 PM »
Hello
I have a backup routine with a string field called loc:desktopfilepath
I want the user to be able to lookup  their own local desktop  path so the created folder is copied there....
Is there a way?
Thanks Richard
NT 14.22

   IF p_web.GSV('loc:Desktopfilepath') = ''
         locsite = 'VisaBackup'&'-'&FORMAT(today(),@D11)       !  loc:Alert ='Desktop filepath is empty - populate location'
      ELSE
         locsite =  p_web.GSV('loc:Desktopfilepath')&'\VisaBackup'&'-'&FORMAT(today(),@D11)
      END
   
      CreateDirectory(locsite)
      copy('User.tps',locsite)
etc

rjolda

  • Sr. Member
  • ****
  • Posts: 315
    • View Profile
    • Email
Re: Desktop File path
« Reply #1 on: May 29, 2024, 01:08:03 AM »
Hi Richard,
Yes, There is always a way.  What are you trying to get done?
Ron

Richard I

  • Sr. Member
  • ****
  • Posts: 398
    • View Profile
    • Email
Re: Desktop File path
« Reply #2 on: May 29, 2024, 06:58:05 PM »
Ron,
In my post you will note I am trying to direct a folder to the users desktop
It appears that the dos filepath template available in Clarion is not applicable to Webapps

So Im creating a folder, copying tps files to it and then the intention is to copy that folder to the users desktop
(The backup routine is working and currently the user needs to navigate to the app folder,copy and paste)

Its similar intent to the  file download app but a folder does not have a suffix.

I await in eager anticipation.....
Regards,
Richard
« Last Edit: May 29, 2024, 07:01:57 PM by Richard I »

Stu

  • Hero Member
  • *****
  • Posts: 510
    • View Profile
    • Email
Re: Desktop File path
« Reply #3 on: May 29, 2024, 08:37:12 PM »
Hi Richard,

How does the webserver have access to the user's desktop to copy the files?

Generally if you want to give the user a way to "get a file to a location", you host it out of the webserver and give them a link to it - when they click they should get the browser option to save/open.

So if you have a rar/zip backup file, you would put that somewhere under the webserver "web" folder, then build a url to that location, put the url on the NetWebForm (or whatever proc you are building), and they click + download.

If you go deeper, you would build a button + progress bar interface (where the progress bar turns into a link to download).

There should be examples that do this.
Cheers,

Stu Andrews

rjolda

  • Sr. Member
  • ****
  • Posts: 315
    • View Profile
    • Email
Re: Desktop File path
« Reply #4 on: May 30, 2024, 12:49:25 AM »
HI RIchard,
I am still not sure what you are trying to do.  Like Stu said - everything that web server accesses should be beneath the web folder  - otherwise you compromise security on your server. 
I am not sure why users would want to work on their local folder?
I do backups but end user has no control - and they are off site and in the cloud...
The best way for users to have access to their machine and run a desktop program AND connect to a web app is to build a net Web Client into the desktop app. 
Ron

seanh

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Desktop File path
« Reply #5 on: May 30, 2024, 03:54:03 PM »
Hi Richard,
No I don't think it can be done the way you would like.
1.  Because the 2 locations are on different machines and not really connected as such.
2.  Because any access to the local system is through the browser, which tends to get locked out of doing that sort of thing for good security reasons.
You can certainly send the file as a download, but the browser and user will still need to interact with it, again for security and because the only connection between you and the user it via the browser.

Richard I

  • Sr. Member
  • ****
  • Posts: 398
    • View Profile
    • Email
Re: Desktop File path
« Reply #6 on: May 30, 2024, 04:32:15 PM »
Thanks Sean and others,
Yes I understand the limitations as outlined.
I am using Amazon virtual servers to host and if possible I am trying to limit users access to those server's desktop.
Saving to the Servers backup is currently an option in the app with the users cutting  and paste back to their local

However I have found I can using the File Download app  bring the backup folder back as a zip file.
which suits and makes it elegant but, the question now is how to programmatically get WinZip to perform the creation  of a zip file
Stu Andrews in this thread mentioned rar backups as a possible solution - i am exploring that.
 
Cheers
Richard



seanh

  • Jr. Member
  • **
  • Posts: 93
    • View Profile
    • Email
Re: Desktop File path
« Reply #7 on: May 30, 2024, 09:14:19 PM »
the question now is how to programmatically get WinZip to perform the creation  of a zip file
Have a look at info zip and 7-zip.  Both are free and have command line versions that make it easier to automate.

https://infozip.sourceforge.net/
https://www.7-zip.org/

Richard I

  • Sr. Member
  • ****
  • Posts: 398
    • View Profile
    • Email
Re: Desktop File path
« Reply #8 on: May 31, 2024, 04:38:40 PM »
Thanks Sean,
Cheers
Richard