Basically instead of an email for a single file transfer for a given
session, I would like a single email that encompasses all of the files
processed for a given session.
Does anyone have any experience with accomplishing this customization?
Thanks,
Steve
Then when the user disconnects send the file over using blat.exe or
sendmail (http://glob.com.au/sendmail/)
c:\windows\system32\cmd.exe /c c:\servu\script\sendfile.cmd
"$FullName" "$UserEmailAddress"
Now sendfile.cmd is as follows:
ECHO From: m...@example.com >"c:\servu\eventlogs\temp\%1"
ECHO To: "%2" >>>"c:\servu\eventlogs\temp\%1"
ECHO Subject: Last transfers >>"c:\servu\eventlogs\temp\%1"
TYPE c:\servu\eventlogs\%1 >>"c:\servu\eventlogs\temp\%1"
ECHO . >>"c:\servu\eventlogs\temp\%1"
WaitAMoment 2000
del "c:\servu\eventlogs\temp\%1"
del "c:\servu\eventlogs\%1"
Be aware that this is an example, you could do it in php (running
php.exe), vbscript (running cscript.exe), jscript, windows shell, bsh
for windows, or whater your liking is for scripting. I just used basic
dumb cmd.exe here.
This is untested but with some fiddling it shoudl work fine.
This one has one drawback, the file created gets sent when the user is
disconnected, but if he is connected twice it is not a good idea to do
it that way. Then you should add $Name in your filename to be used and
to be sent.
Ok it was a bit technical but you asked a specific question which can
be resolved in dozens of ways.
You could also make an integreation dll for it to do that work (only
for serv-u 9 and up).
WaitAMoment is available from my mini site http://tinyurl.com/ftpservertools
and is off course also totally free.
All it does is wait for a number of milliseconds..
This is the part that I am testing:
First create the events you want to log e.g. File Uploaded with
Execute Command
c:\windows\system32\cmd.exe /c echo uploaded: $FileName >>c:\servu
\eventlogs\$FullName
Does this create temp directory or a temp file with the file name?
> WaitAMoment is available from my mini sitehttp://tinyurl.com/ftpservertools
I was kinda doing this almost by head, just checking the help files.
This is just an option but you could also do it very differently, e.g.
with vbscript...
c:\windows\system32\cscript.exe //b c:\servu\LogEvents.vbs $Name
UPLOAD $FileName
And LogEvents.vbs being (untested but I assume you can correct the
mistakes since it is simple vbscripting).
Dim fso, f1
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpentextFile("c:\servu\logfiles
\"+wscript.arguments(0)+".log",8)
f1.WriteLine(wscript.arguments(1)+" "+wscript.arguments(2))
f1.Close
That would open/create a file in c:\servu\logs (dir must exist!!) and
write a line in it...
As I said you can resolve this in so many ways... All you need is some
scripting to write to a temporary file and then when the user logs off
or disconnects to send the file to the user... The system variables
have a lot of power...
Alternatively you could make yourself a dll in servu 9 as well... This
is somewhat more complicated tho the guys from servu put a complete
working example in the servu dir. You would need a compiler tho
(visual studio preferred).
Do you have any working examples of a summary email notification that
I could reference?