M
Michael Kujawa
Hi all,
If anyone has experience with Dynu FTP object maybe
you could help me out. Hopefully it is a simple solution.
I "have" referred to the component documentation and I
am still having troubles transferring a file in ascii mode
I am sure I am doing this correctly but I still am getting
binary transfer type and not an ascii transfer. Basically a
user uploads a file via internet. The file then gets unzipped
and the unzipped file is sent to a tandem server. Lastly the
zipped and unzipped files are deleted from the user upload
point.
everything works except for the transfer type using dynu ftp
It HAS to be ascii.
<%
zs.open "select * from FTSUsers where UserID='" & Session("UserID") & "'",
connstrx, 3, 4
if not zs.eof then
pUsername=rtrim(zs("TLogin"))
pPassword=rtrim(zs("Tpassword"))
pDirectory=rtrim(zs("TFTPDIR"))
Response.Write "<br>File uploaded Directory is: " & pDirectory
Response.Write "<br>Tandem Login is: " & pUsername
Response.Write "<br>Tandem Password is: " & pPassword & "<br>"
else
end if
zs.close
Set objZip = Server.CreateObject("XStandard.Zip")
objZip.UnPack Session("file2"), "\ \ myserver\uncshare\ " &
Session("UserDir") & "\InStage\"
For Each objItem In objZip.Contents(Session("file2"))
Session("file3") = "\ \ myserver\uncshare\ " & Session("UserDir") &
"\InStage\" & objItem.Name
Session("file4") = objItem.Name
Next
Set objZip = Nothing
Response.Write "<br>File Path is: " & Session("file3")
Response.Write "<br>File Name is: " & Session("file4") & "<BR><BR>"
Set oFTP = Server.Createobject("Dynu.FTP")
pServer = "10.85.217.30"
pLocalfile = Session("file3")
pRemoteFile = pDirectory & "/" & Session("file4")
If oFTP.Connect(cstr(pServer), cstr(pUsername), cstr(pPassword), 21) Then
Response.Write "Logged on to Ftp server successfully!"
If oFtp.PutFile(cstr(pLocalfile), cstr(pRemoteFile), , "ascii") Then
Response.Write "<BR>" & oFTP.ReturnMessage & "<br>"
Response.Write "<br>File uploaded successfully!"
Else
Response.Write "<br>File upload failed!"
Response.Write "<BR>" & oFTP.ReturnMessage & "<br>"
End If
Else
Response.Write "<br>Login to Ftp server failed!<br>"
End If
set oFTP = nothing
Set Upload = Server.CreateObject("Persits.Upload")
Upload.DeleteFile Session("file2")
Upload.DeleteFile Session("file3")
%>
and the error I get is:
553 Error: Structured file transfer only allowed in ascii mode
If anyone has experience with Dynu FTP object maybe
you could help me out. Hopefully it is a simple solution.
I "have" referred to the component documentation and I
am still having troubles transferring a file in ascii mode
I am sure I am doing this correctly but I still am getting
binary transfer type and not an ascii transfer. Basically a
user uploads a file via internet. The file then gets unzipped
and the unzipped file is sent to a tandem server. Lastly the
zipped and unzipped files are deleted from the user upload
point.
everything works except for the transfer type using dynu ftp
It HAS to be ascii.
<%
zs.open "select * from FTSUsers where UserID='" & Session("UserID") & "'",
connstrx, 3, 4
if not zs.eof then
pUsername=rtrim(zs("TLogin"))
pPassword=rtrim(zs("Tpassword"))
pDirectory=rtrim(zs("TFTPDIR"))
Response.Write "<br>File uploaded Directory is: " & pDirectory
Response.Write "<br>Tandem Login is: " & pUsername
Response.Write "<br>Tandem Password is: " & pPassword & "<br>"
else
end if
zs.close
Set objZip = Server.CreateObject("XStandard.Zip")
objZip.UnPack Session("file2"), "\ \ myserver\uncshare\ " &
Session("UserDir") & "\InStage\"
For Each objItem In objZip.Contents(Session("file2"))
Session("file3") = "\ \ myserver\uncshare\ " & Session("UserDir") &
"\InStage\" & objItem.Name
Session("file4") = objItem.Name
Next
Set objZip = Nothing
Response.Write "<br>File Path is: " & Session("file3")
Response.Write "<br>File Name is: " & Session("file4") & "<BR><BR>"
Set oFTP = Server.Createobject("Dynu.FTP")
pServer = "10.85.217.30"
pLocalfile = Session("file3")
pRemoteFile = pDirectory & "/" & Session("file4")
If oFTP.Connect(cstr(pServer), cstr(pUsername), cstr(pPassword), 21) Then
Response.Write "Logged on to Ftp server successfully!"
If oFtp.PutFile(cstr(pLocalfile), cstr(pRemoteFile), , "ascii") Then
Response.Write "<BR>" & oFTP.ReturnMessage & "<br>"
Response.Write "<br>File uploaded successfully!"
Else
Response.Write "<br>File upload failed!"
Response.Write "<BR>" & oFTP.ReturnMessage & "<br>"
End If
Else
Response.Write "<br>Login to Ftp server failed!<br>"
End If
set oFTP = nothing
Set Upload = Server.CreateObject("Persits.Upload")
Upload.DeleteFile Session("file2")
Upload.DeleteFile Session("file3")
%>
and the error I get is:
553 Error: Structured file transfer only allowed in ascii mode