Rename file in Pre Upload Script

Core FTP client questions and answers
Locked
DVM_admin
Posts: 2
Joined: Tue Feb 18, 2014 5:41 pm

Rename file in Pre Upload Script

Post by DVM_admin »

Here my code, everything works except instead of uploading the file with the new file name, it uploads a blank file with the original filename.

i.e.: instead of uploading the encrpted file xyz.dat.txt.gpg it uploads a blank file called xyz.dat

preupload:
"G:\crd\Exports\Fidelity\Scripts\upload.bat" "%1"

post upload:
cmd.exe /c del "%1"



REM upload.bat
@echo off
g:
chdir "G:\exports\"
del encrypted.dat
rem create a 'processed' directory to copy original files into.
copy %1 .\processed\
rename %1 encrypted.dat
gpg --recipient djfbksfkjsd.com --output %1%.txt.gpg --encrypt encrypted.dat
set 1=%1%.txt.gpg
del encrypted.dat
ForumAdmin
Site Admin
Posts: 1004
Joined: Mon Mar 24, 2003 4:37 am

Post by ForumAdmin »

You won't be able to rename the original filename in your batch file for Core FTP, it would need to be the same filename in order for it to transfer.
Locked