Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Ftp ~ ala Connect Network drive

Posted on 1998-11-06
5
219 Views
Last Modified: 2010-04-04
Hi there

Short question, but probaly rather dificult :-(

Is there a way to connect a FTP page as connecting a network drive, so you can browse the FTP page as your own drive (I only need to download files from the page)
0
Comment
Question by:koger
  • 3
  • 2
5 Comments
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345945
koger

This is possible I have seen it done in ipswitch FTPPro, when you connect to an FTP site it adds it into your windows explorer as a "Mapped Drive" and you can browser the FTP from there, Maybe what you can do is once connect map a network drive to this connection then explorer etc will look at it as a drive until the connection is killed, you could use the API call WNetAddConnection2W like so

  function WNetAddConnection2W(var lpNetResource: TNetResourceW;
    lpPassword, lpUserName: PWideChar;
    dwFlags: DWORD): DWORD; stdcall;

then map the network drive from a button click or so...

procedure TForm1.Button1Click(Sender: TObject);
var
  NRW: TNetResource;
begin
  with NRW do
  begin
    dwType := RESOURCETYPE_ANY;
    lpLocalName := 'X:'; // map to this driver letter
    lpRemoteName := '\\MyServer\MyDirectory';
    // Must be filled in.  If an empty string is used,
    // it will use the lpRemoteName.
    lpProvider := '';
  end;
  WNetAddConnection2(NRW, 'MyPassword', 'MyUserName',
    CONNECT_UPDATE_PROFILE);
end;

Once you have the connection and the mapped drive execute windows explorer

ShellExecute(Handle, 'open', 'explorer.exe', 'Your mapped drive here', '', SW_SHOWNORMAL);

and you should have a mapped drive to the connection which will allow you to browse it in the windows explorer...

Hope this is what you are after...

Later
BoRiS
0
 

Author Comment

by:koger
ID: 1345946
Hi, sorry for the long reply.

lpRemoteName := '\\MyServer\MyDirectory';

Isn't this a network adresse.

Where should I put the Host adresse.
0
 
LVL 4

Expert Comment

by:BoRiS
ID: 1345947
koger

right were the lpProvider space is...

lpProvider := 'ftp://ftp.cdrom.com';

lpRemoteName is npnc (\\...\...) but this is required for the mapped drive to map correctly
you could connect to the server and then retrieve the directory and pass it to the lpRemoteName

Later
BoRiS
0
 

Author Comment

by:koger
ID: 1345948
Oh, okay, just make an answer so can get your points ;-)
0
 
LVL 4

Accepted Solution

by:
BoRiS earned 100 total points
ID: 1345949
koger

Here you go, as asked just an answer for the points...

Later
BoRiS
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
select query - oracle 16 100
Convert a string into a TDateTime 5 64
SUM 2 INTEGER ARRAYS INTO 1 10 108
How to insert .png images to TClientDataSet .cds file? 2 32
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question