Hi,
My team is trying to connect with a secure internet directory contents in classic ASP code. The FTP is connecting with user name and password. but it takes a lot of time (15 minutes) just to download a simple xml file. if i access the same directory with IE browser. it asks user name and password and when i enter it it logs in the directoy and shows the directory listing. if i then download a file from IE it takes only 5 seconds to download 70KB XML file. so the question why the classic ASP code taking so much time.
one thing that is the directory contains a lot of XML file around 800,000 so when i connect with IE to the directory then it takes a lot of time displying the whole directory contents. IS IT THE CASE with FTP connection in ASP code that it is also downloading that directory contents.
ASP code is give below
Shahzad Aslam
' Build our ftp-commands file
Set objTextFile = objFSO.CreateTextFile(Serv
er.MapPath
("test.ftp
"))
objTextFile.WriteLine "lcd " & Server.MapPath(".")
objTextFile.WriteLine "open " & ftp_address
objTextFile.WriteLine ftp_username
objTextFile.WriteLine ftp_password
' Check to see if we need to issue a 'cd' command
If ftp_remote_directory <> "" Then
objTextFile.WriteLine "cd " & ftp_remote_directory
End If
objTextFile.WriteLine "prompt"
' If the file(s) is/are binary (i.e. .jpg, .mdb, etc..), uncomment the following line
objTextFile.WriteLine "binary"
' If there are multiple files to put, we need to use the command 'mput', instead of 'put'
If Instr(1, ftp_files_to_put, "*",1) Then
objTextFile.WriteLine "mput " & ftp_files_to_put
Else
objTextFile.WriteLine "put " & ftp_files_to_put
End If
objTextFile.WriteLine "bye"
objTextFile.Close
Set objTextFile = Nothing
' Use cmd.exe to run
ftp.exe, parsing our newly created command file
strCMD = "
ftp.exe -s:" & Server.MapPath("test.ftp")
strTempFile = "C:\" & oFileSys.GetTempName( )
oFileSys.copyfile ftp_address & ftp_remote_directory & ftp_files_to_put , "c:\1011.xml"
Start Free Trial