SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Unable to Send Files to FTP Server


Unable to Send Files to FTP Server

Author
Message
kthejoker
kthejoker
SSC Journeyman
SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)SSC Journeyman (86 reputation)

Group: General Forum Members
Points: 86 Visits: 127
1) Make Sure your remote path actually exists. I got this error because I was pointing to a subdirectory that someone had subsequently removed.

2) Use the format /DIR/SUBDIR/SUBDIR for your RemotePath.

3) You can't have spaces in your directory names. Maybe you can with a remote path variable, haven't tried it.
vijay.msbi
vijay.msbi
SSC Journeyman
SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)SSC Journeyman (98 reputation)

Group: General Forum Members
Points: 98 Visits: 80
Hello,

exactly i used same above code to send a file to FTP server.But my script task remains in execution mode all the time ( Yellow ).
can any please suggest wat happening in my code . I have tested my FTp connection in Script task as well as in FTP connection manger : working perfectly

Imports System
Imports System.Data
Imports System.Math
Imports Microsoft.SqlServer.Dts.Runtime

Public Class ScriptMain



Public Sub Main()



Try

Dim cm As ConnectionManager = Dts.Connections.Add("FTP")

cm.Properties("ServerName").SetValue(cm, "S-SQL15.apollo.zeus.internal")

cm.Properties("ServerUserName").SetValue(cm, "FTPUser")

cm.Properties("ServerPassword").SetValue(cm, "ftpconnection@123")

cm.Properties("ServerPort").SetValue(cm, "21")

cm.Properties("Timeout").SetValue(cm, "0")

cm.Properties("ChunkSize").SetValue(cm, "1000") '1000 kb

cm.Properties("Retries").SetValue(cm, "1")

Dim ftp As FtpClientConnection = New FtpClientConnection(cm.AcquireConnection(Nothing))

'Connects to the ftp server
ftp.Connect()



Dim files(0) As String

files(0) = "C:\TestFtp.txt"

ftp.SendFiles(files, "/", True, False)

ftp.Close()

Catch ex As Exception

Dts.TaskResult = Dts.Results.Failure

End Try

Dts.TaskResult = Dts.Results.Success



End Sub

End Class
suri.yalamanchili
suri.yalamanchili
Old Hand
Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)Old Hand (349 reputation)

Group: General Forum Members
Points: 349 Visits: 539
If you are able to transfer manually ,try using passive mode on ftp manager. Enable the logging for the client you are using to transfer manually for any additional settings.
donna_123_a
donna_123_a
SSC Rookie
SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)

Group: General Forum Members
Points: 42 Visits: 114
You may need to set your destination folder to the following:

/myaccountname/dir/subdir/subdir/
(where "myaccountname" is your login to the FTP site.)


Instead of just:

/dir/subdir/subdir/


This worked for me and stopped the following error:
Unable to send files using "FTP".

Donna



donna_123_a
donna_123_a
SSC Rookie
SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)SSC Rookie (42 reputation)

Group: General Forum Members
Points: 42 Visits: 114
You may need to set your destination folder to the following:

/myaccountname/dir/subdir/subdir/
(where "myaccountname" is your login to the FTP site.)


Instead of just: /dir/subdir/subdir/

This worked for me and stopped the following error: Unable to send files using "FTP".

Donna



raju400
raju400
SSC Rookie
SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)SSC Rookie (41 reputation)

Group: General Forum Members
Points: 41 Visits: 104
Hi Guys...need help in ftp..
my local folder has 100 files and each day files are added to this local folder has date and time in the file name as abc_2013.07.30.12.00.tmp , I want to send the latest file to ftp server using ssis package ??is this possible ???

Any help pls ????
Suresh.Utham
Suresh.Utham
Mr or Mrs. 500
Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)Mr or Mrs. 500 (546 reputation)

Group: General Forum Members
Points: 546 Visits: 216
When I set "Use Passive Mode" in connection manager, it worked! (but FTP Task is not helpful since it's saying Password is not allowed).

Suresh
SUBRAHMANYA HEDGE
SUBRAHMANYA HEDGE
SSC-Addicted
SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)SSC-Addicted (481 reputation)

Group: General Forum Members
Points: 481 Visits: 406
MSSQLBuddy (2/16/2009)
Hi,

Thank u so much. I can upload now.

The problem is that "I shouldn't specify the remote file name. only "/" in remote file succeeds sending file to ftp server"

Thanks again.

Priya


@MSSQLBuddy
Thanks !! You saved my day !!
info 36942
info 36942
Valued Member
Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)

Group: General Forum Members
Points: 54 Visits: 42
Thank you - this solved my issue!

MSSQLBuddy (2/16/2009)
Hi,

Thank u so much. I can upload now.

The problem is that "I shouldn't specify the remote file name. only "/" in remote file succeeds sending file to ftp server"

Thanks again.

Priya

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search