Jump to content
troms

Email a Uploaded File

Recommended Posts

Has anyone come across a way to run a script that generates a file, that file then gets uploaded to the labtech server, and then labtech attaches that file to a email and sends it to a specific email account,

 

the first part of that is easy but I have found no way to tell labtech to look at this file path grab this file and email it to this address, as basically trying to automate the sending of a AD export to csv to a 3rd party

Share this post


Link to post
Share on other sites

The File Upload step creates an internal variable named "%uploadedfile%". Just use that as the attachment path in the "Email" script function step.

Share this post


Link to post
Share on other sites

ok update to this, once the file is upload and then emailed is there a way to script a delete of that file off the labtech server, i tried using the %uploadedfile%  variable with the file delete and it seems to list the path but says it can't find the file to delete it,

 

Parameters: C:\LTShare\Uploads\client\server\AU.csv
Output: ERR an error occurred: Could not find a part of the path C:\LTShare\Uploads\client\server\AU.csv

or perhaps i should be using a command other then file delete to accomplish this.

any help is greatly appreciated.

Edited by troms

Share this post


Link to post
Share on other sites

@troms I tried getting the same exact thing to work before and gave up.
Needless to say at least yours is getting some traction and hopefully a working script! 

 

Share this post


Link to post
Share on other sites

yeah I tried for awhile not much success i finally just setup a scheduled task on the server to purge the files in the uploads directory once a week

Share this post


Link to post
Share on other sites

I think that would be problematic because I believe there is a link to it in the database.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×