September 17, 2008 at 2:08 pm
All, 🙁
Need help for the following. I need to be able to copy a file to Vendor's FTP on weekly basic.
I have the following in my Script Task.Upon execution it returns ArgumentException [xxx.com/123/Files/File1.zip'is not a valid remote file address. A valid address should include a protocol, a path and a file name]
Here is what I have in my Script Task
Dim server As String = "//ftp://xxx.com/123/Files/"
Dim User As String = "User1"
Dim Password As String = "Password1"
Dim remoteFTP As String = server & System.IO.Path.GetFileName(file.FullName)
My.Computer.Network.UploadFile(file.FullName, remoteFTP, User, Password, True, 500)
While Debugging the remoteFTP string displays
= "//ftp://xxx.com/123/Files/File1.zip"
I've nvr copied a file to a ftp before.Therfore Im not sure if this code is even correct.Ive got it from http://social.msdn.microsoft.com/forums/en-US/vblanguage/thread/7945dbd9-5836-4eaa-b8fe-32ad70002e43.
Appreciate if someone could help me out. Thank You.
Im just soo stuck on this piece.
September 17, 2008 at 2:48 pm
Tried changing
Dim server As String = "//ftp://xxx.com/123/Files/"
to
Dim server As String = "ftp://xxx.com/123/Files/"
and I get the following Exception
The remote server returned an error: (550) File unavailable (e.g., file not found, no access).
September 18, 2008 at 6:39 am
Anybody out there used this before ?:sick:
I need to get this done with.
September 18, 2008 at 6:23 pm
Have you tried using the FTP Task or do you need to use a Script Task for some reason?
I've never used it before but it may solve your issue.
September 18, 2008 at 6:32 pm
Hi Paul,
Im thinking to use FTP Task now,Do you have any ideas on how I can
only send files that have todays date in it to the Vendor.
File names are similar to this format AA09182008.zip.There are 6 file in total,all file name's have todays date in [mmddyyyy] in it.
Appreciate your help!Thanks
September 18, 2008 at 6:40 pm
You will need to loop through all the files and send them one by one (unless there is a bulk send option somewhere that I haven't heard of) so I guess you can have a script task up front (before the loop) that gets all the files you are after into a collection. Then you can loop through them and set the source file connection settings are necessary and feed that into the ftp task.
September 18, 2008 at 6:44 pm
You mean to say have a script task to get files with todays date.Store the file names in a location.Put a FTP task in a for loop and loop through all the files to the FTP Task by passing the file name as a variable.I will try this tom.Do let me know if this is correct?
September 18, 2008 at 6:50 pm
Yeah but I'm not sure if you can simply pass the filename as a variable to the FTP Task. I think the FTP Task will expect a source file connection manager, so you may need to set the file path variable in the connection manager.
September 18, 2008 at 6:53 pm
I shall try tom and update my doubts.Thank You.
September 25, 2008 at 12:47 pm
I solved it using this
September 25, 2008 at 2:17 pm
LOOKUP_BI (9/25/2008)
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=110841%5B/quote%5D
He meant this 😛 (saves you guys a click)
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply