|
Home > Archive > IIS FTP Server > September 2005 > Script to upload a file to a FTP server and delete the file -only if sucessful
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Script to upload a file to a FTP server and delete the file -only if sucessful
|
|
| NeMacGuy 2005-09-01, 6:02 pm |
| I setup a scripts to download and upload some files with our EDI
providor. I am having a problem when their system goes down, my upload
script runs, the FTP connection fails, and the next line of my script
is a del *.edi which deletes my file, but the data was not sent. I
would love to move the file -vs- copy the file then I would not have to
delete it.
Any help would be loved!!
| |
| Chris Crowe [MVP] 2005-09-02, 8:48 pm |
| It depends on what script language you are using but there should be a way
to test if your FTP command failed.
Even something like this in vbscript for Window Scripting Host may work
FTPCommand
if (err <> 0) then
WScript.Echo "Sorry FTP failed for some reason! " & err.Description
end if
--
Cheers
Chris
Chris Crowe [IIS MVP]
http://blog.crowe.co.nz
"NeMacGuy" <peloffis@hotmail.com> wrote in message
news:1125603325.271843.64520@g44g2000cwa.googlegroups.com...
>I setup a scripts to download and upload some files with our EDI
> providor. I am having a problem when their system goes down, my upload
> script runs, the FTP connection fails, and the next line of my script
> is a del *.edi which deletes my file, but the data was not sent. I
> would love to move the file -vs- copy the file then I would not have to
> delete it.
>
> Any help would be loved!!
>
|
|
|
|
|