Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have a task in which access the files on server 1 and insert in table in var binary format.

suppose i have a path of particular folder contain text file with IP address of server 1 also have the credentials of server 1.
Now i have to make a program which will be hit on server 1 and fetches all file placed on that path and insert into attachment table in var binary format.

so will you please tell me what is the best method to do the above task, please provide a small sample in c#.

Thanks in advance.
Posted

1 solution

Why have you tagged your post FTP ? do you really need FTP ?

If you have credentials for the server, you have two options

a) create a permanent share on the server where the files you need are located, then create a permanent map to a drive on your work machine

b) almost as per (a), but map a drive to the server/share when you need it - forget the forms based sample in the link that follows, look at the example code - you can create and take-down a share dynamically http://www.codeguru.com/csharp/csharp/cs_network/windowsservices/article.php/c12357/C-Map-Network-Drive-API.htm[^]

as for the 'best method' - if you're on an internal network and the server is 'stable', either options is good
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900