Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to use get dir command/function in html sript

Status
Not open for further replies.

keisha1

Programmer
Mar 28, 2019
22
PH
I have program in HTML/AVFP with using textbox and button
I had already found a Command for GETFILE that was successfully run to get the target file to be displayed from textbox.
but other problem for second line textbox w/command button is how to display this only the directory/folder with contains many text files inside, it should be displayed in the textbox upon clicking the target folder.
see sample html/avfp codes for target file
<P>Find Files to be uploaded:</p>
<p><input TYPE="FILE" SIZE="60" NAME="FILE1"></p>

See attached sample screen program
for GET DIRECTORY
Kindly help how to code for GETDIRETORY
FORMAT-SCREEN_bmmrpn.jpg
 
I think for something like that you are going to need a more complex tool.

If you google uploadifive you will probably be able to find what you are looking for.

It's not exactly hard to use, but it does take a bit of commitment to get it running.

You will also need something like Persits ASPUpload on your server to process the file transfers.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
This might work:

Code:
<input type="file" webkitdirectory mozdirectory msdirectory odirectory directory multiple>

I found it here:


Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Many Thanks GriffMG,

but how about if I want only to display is the path/directory(C:\Folder-1015\) for the 2nd text box not included the *.txt files to display because I want try the For statement command to append all .txt files into one database table using FOR statement if possible.
Ex:
<
cImportTXTFiles = ADIR(MaryDir, ADDBS(McImportDir) + "*.txt")
<FOR nFileCntr = 1 TO cImportTXTfiles
cTXTFile = ADDBS(cImportDir) + maryDir(nFileCntr,1)
SELECT dbftable >
APPEND FROM (cTXTFile) type sdf
ENDFOR >

If you have simple techniques how to do this process using in avfp/html, this will be most highly appreciated. many thanks again
 
So, you have a textbox that contains a fully-qualified wildcard filename (such as [tt]c:\demo\*.txt[/tt]), and you want to extract just the path ([tt]c:\demo[/tt]). Is that right?

If so, you want the JUSTPATH() function. So, [tt]JUSTPATH("c:\demo\*.txt")[/tt] would return [tt]c:\demo[/tt].

Does that help at all?

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
You're using AFVP - active vfp on a web server, right?

Well, if you only send over a directory name, this doesn't give a server access to the client local directory, the two client and server are only connected via the http protocol, the server has no accesss to local drives, it only can process what is sent to it. In short: You're now doing client/server programming, the code runs mainly serverside, clientside you only have the HTML form.

So you have to change your strategy. Either you waste bandwidth and transfer time and upload a whole folder, so the server has a copy and picks out the files matching or you need to learn enough javascript to filter out the files to send over beforehand and the server side code then can append all of the sent files.

Transition from a desktop application to a client/server isn't just 1:1 code reusage, you have a separation that you need to take into account.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top