Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

ftp get file without extension

$
0
0

Hi


I'm trying to use the sample code from http://blog.dbandbi.com/tag/ssis-script-task-check-if-file-exists-c/

publicvoid Main(){string userName = Dts.Variables["User::userName"].Value.ToString();string password = Dts.Variables["User::password"].Value.ToString();string fileName = Dts.Variables["User::fileName"].Value.ToString();string ftpURL =String.Format("ftp://ftp.dbandbi.com/public_ftp/incoming/{0}",fileName); try{
       FtpWebRequest ftpRequest =(FtpWebRequest)WebRequest.Create(ftpURL);
       ftpRequest.Method= WebRequestMethods.Ftp.DownloadFile;
       ftpRequest.Credentials=new NetworkCredential(userName, password); using(FtpWebResponse ftpResponse =(FtpWebResponse)ftpRequest.GetResponse()){
           Dts.Variables["User::isFileExists"].Value=true;}}catch{
       Dts.Variables["User::isFileExists"].Value=false;} 
	Dts.TaskResult=(int)ScriptResults.Success;}

but I'm having problems because the files are in unix format and they don't have extension. I  tried using filename*.* and filename*  but I always get "file does not exist".  What I'm trying to do is to know if the file created by another process has been freed so I can download it.

thanks in advance


cognosoft



Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>