Previous Thread
Next Thread
Print Thread
Windows file explorer options/recommendation #34491 10 Aug 21 05:50 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Good day,

I have a project where i will need to give the user access to locate files on a pc/network and then save or import them into linux. I would like to be able to allow the user to select multiple files at once. I am aware there are multiple options for this, but instead of wasting time pecking thru these i thought i would start with recommendations of what worked for others.

TIA

Re: Windows file explorer options/recommendation [Re: Frank] #34493 11 Aug 21 11:48 AM
Joined: Jun 2001
Posts: 3,376
J
Jorge Tavares - UmZero Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 3,376
Hi Frank,
Apologize but anything related to Linux it's completely out of my scope, in my exclusively Windows world, what you want resumes to open Explorer (MX_GETOFD) with the multiple select flag set (OFN_ALLOWMULTI­SELECT) and you're done or, use the new drag&drop technique (MX_DRAGDROP)

Have fun


Jorge Tavares

UmZero - SoftwareHouse
Brasil/Portugal
Re: Windows file explorer options/recommendation [Re: Frank] #34494 11 Aug 21 01:10 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Good morning Jorge - thanks for the reply, that is a good start!

If i can then get a list of files passed back to the program i can perform the transfer into linux.

Thanks wink

Re: Windows file explorer options/recommendation [Re: Frank] #34496 11 Aug 21 03:50 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
GETOFD works fine, thanks. I can get the selected filespec in the returned "path" parameter.

*though i must say not very elegant to strip off the path from the first file and apply to remaining selected files for processing. Instead of providing an optional fname with stripped name only it would have been nice to have a separate path variable to pair with the fname. With that being said, fname is not populated with the multiselect option. Not requesting changes just complaining... laugh

Re: Windows file explorer options/recommendation [Re: Frank] #34497 11 Aug 21 03:51 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
Indeed, that's exactly the approach I would suggest. There's a decent example/demo of MX_GETOFD in the MIAMEX.BP[908,30] in the EXLIB. The prompts look like this ...
Code
<select function 95 from the list>

xcall MIAMEX,95,... (Windows open file dialog)

Starting dskn:file.ext[p,pn] (optional): c:\temp
Filter (descr1|wildspec1;...;wildspecn{|descr2|wild1;...wildn})
   ? CSV files|*.csv
Title: Test Multi File Select/Transfer
Flag options (sum together):
      4   Hide readonly
      8   Don't allow directory change
    128   Select Folder only (5.1)
    512   Allow multiselect (usually add 524288 also)
   2048   Path must exist
   4096   File must exist
   8192   Prompt to confirm if nonexistent file entered
 131072   Disable network button
 524288   Force explorer format (default unless 512 used)
Flags: 512
Default Extension: csv
Enter 0=Open File Dialog, 1=Save File Dialog: 0


After then selecting 3 files from the resulting Open File dialog, the response is:

Code
Full Path = C:\Temp\080721s.csv
080721z.csv
080721fr.csv


Note that all of the files will have to be in the same directory (this is a limitation of the Windows dialog, not of MIAMEX), so the path is included with only the first file (c:\temp here). The example doesn't transfer the files, but presumably you know how to do that, either with ATEAPX, or FTP2 or MX_ATEFILEXFR)

Re: Windows file explorer options/recommendation [Re: Frank] #34498 11 Aug 21 03:56 PM
Joined: Jun 2001
Posts: 11,645
J
Jack McGregor Online Content
Member
Online Content
Member
J
Joined: Jun 2001
Posts: 11,645
<crossing posts>

I feel your pain, but I think it can be most effectively balanced with the pleasure of the handy SOSLIB functions for merging and splitting pathnames, found in the module fnsplitpth.bsi ...

Code
!FUNCTIONS
!  Fn'MergePaths$(root$,dir$,fname$,flags)  - merge parts into one fqfs
!  Fn'SplitPath$(path$,fname$)              - separate fqfs into dir, fname.ext
!  Fn'ConcatPaths$(path1$,path2$,flags)     - concat two paths
!  Fn'AutoQuotePath$(path$)                 - quote path$ if it contains spaces
!  Fn'AbbrPath$(path$,maxlen)               - shorten path$ for display (middle ellipsis)

Re: Windows file explorer options/recommendation [Re: Frank] #34499 11 Aug 21 04:06 PM
Joined: Sep 2002
Posts: 5,450
F
Frank Online Content OP
Member
OP Online Content
Member
F
Joined: Sep 2002
Posts: 5,450
Thanks Cap smile


Moderated by  Jack McGregor, Ty Griffin 

Powered by UBB.threads™ PHP Forum Software 7.7.3