ftp automation

ScriptFTP

The professional tool to automate FTP, SFTP, FTPS and schedule FTP batch jobs

The forum is now read only. Please, go to the the main ScriptFTP website if you need help.
Need help writing a script? Have any question about ScriptFTP?
Greetings,

We script the upload of EDI files to our back office system however the back office system sometimes attempts to process a partially uploaded file. I am unable to use the OK file method so I am thinking either write the files to a temp dir on the remote server and then move them once uploaded to the remote processing directory or upload them with a .temp extension on them and remove the .temp extension on successful upload.

Which is the best method and would anyone be so kinds as to provide an example?

The current script I use also moves a local copy once uploaded for historic reference
Code: Select allOPENHOST("server_name","user","passwd") CHDIR ("\EDI_IN") # Change working directory LOCALCHDIR("C:\EDI_Outbound") # Retrieve the  file listing $result=GETLIST($list,LOCAL_FILES,"*.*") # If GETLIST failed stop the script IF($result!="OK") STOP END IF # For each file in $list... FOREACH $item IN $list # Upload the file $result=PUTFILE($item) # If the file has been succesfully uploaded                 # delete the local copy of the file IF($result=="OK") EXEC('move "'.$item.'" "C:\EDI_Outbound\processed"') END IF END FOREACH  

Thanks in advance!
so I am thinking either write the files to a temp dir on the remote server and then move them once uploaded to the remote processing directory or upload them with a .temp extension on them and remove the .temp extension on successful upload.
Actually, this is what ScriptFTP actually does by defualt, but instead of using .temp it uses the .part.
Is there a way to turn off this?

Here's how it's giving us fits.

Code: Select allPUTFILE2("icd8000.0157","PEC.TF01.R0ECDOHC.ICLFILE(+1)") Uploading.................      icd8000.0157 as PEC.TF01.R0ECDOHC.ICLFILE(+1) DELE icd8000.0157.part 500 User Exit denies Userid 'OHCS0101' from using Command 'DELE'. PASV 227 Entering Passive Mode (10,33,55,136,234,75) Opening data connection to 10.33.55.136 Port: 59979 STOR PEC.TF01.R0ECDOHC.ICLFILE(+1).part 501 Invalid data set name "PEC.TF01.R0ECDOHC.ICLFILE(+1).part". Use MVS Dsname conventions. ***** PUTFILE2 Error #17501: Cannot upload local file icd8000.0157. ***** The server said: Invalid data set name "PEC.TF01.R0ECDOHC.ICLFILE(+1).part". Use MVS Dsname conventions. CWD 'FTOHCS01.'

How can I tell the software we are just not cool enough to use it's built in error correction?

thanks so much!
And, for the second time today, I have solved my own problem I am my best tech support.

Using the SETUPLOADMODE(mode) with the (mode) set to (DIRECT) should do the trick, I think.

I won't be able to test till tomorrow's production day, but I think that solves that issue.
Yes, that solves your problem. Using SETUPLOADMODE(DIRECT) makes ScriptFTP to upload the files without the ".part" after the file name.

If you have any further questions feel free to ask by email :) (However I usually check the forum on a daily basis)