Solved

Ftp ~ ala Connect Network drive

Posted on 1998-11-06
5
216 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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 …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

786 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