Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with file extension in FTP

Status
Not open for further replies.

mydisney

Programmer
May 7, 2007
55
US
I have a script that automates ftp and selects files in a specific folder with a specific extension. We are using a pgp product to encrypt prior to the ftp. When we encrypt the files get an .pgp extension automatically.

The problem is: When I use the .pgp extension (created by pgp software) it will not ftp the files.(see line: strFilePut = "*.pgp". If I set the extension of the files to .txt the ftp works fine.

Any ideas???

' VBScript FTP Upload to St Paul Travellers and Rename Files
Option Explicit
Dim objFSO, objMyFile, objShell, strFTPScriptFileName, strFilePut
Dim strLocalFolderName, strFTPServerName, strLoginID
Dim strPassword, strFTPServerFolder

'Set FTP options
strLocalFolderName = "c:\myftpfolder\myftpfiles\"
strFTPServerName = "ftp.client.com"
strLoginID = "userid"
strPassword = "password"
strFTPServerFolder = "client_folder"

'Set File name
strFilePut = "*.pgp"

'Generate FTP command
strFTPScriptFileName = strLocalFolderName & "\FTPScript.txt"

Set objFSO = CreateObject("Scripting.FileSystemObject")

If (objFSO.FileExists(strFTPScriptFileName)) Then
objFSO.DeleteFile (strFTPScriptFileName)
End If

Set objMyFile = objFSO.CreateTextFile(strFTPScriptFileName, True)
objMyFile.WriteLine ("open " & strFTPServerName)
objMyFile.WriteLine (strLoginID)
objMyFile.WriteLine (strPassword)
objMyFile.WriteLine ("cd " & strFTPServerFolder)
objMyFile.WriteLine ("bin")
objMyFile.WriteLine ("lcd " & strLocalFolderName)
objMyFile.WriteLine ("prompt")
objMyFile.WriteLine ("mput " & strFilePut)
objMyFile.WriteLine ("disconnect")
objMyFile.WriteLine ("bye")
objMyFile.Close

Set objFSO = Nothing
Set objMyFile = Nothing

'Run ftp script
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run ("ftp -s:" & chr(34) & strFTPScriptFileName & chr(34))
Set objShell = Nothing


 
Just some guesses:
1) are by chance the automatically created .pgp files hidden ?
2) some security rules forbidding the transfert of .pgp files ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
I do not think the .pgp files are hidden. The encryption is done manually using the pgp desktop version and put into an out folder. The type of file for the .pgp extensiong is "PGP Zip". Not sure if that could create a problem. About security I am not sure. If I create a dos script and run the ftp -s:xxxxx.txt command it works fine. It ftp's all the .pgp extension files. In VB script this does not happen.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top