orangeparrot Posted July 14, 2008 Share Posted July 14, 2008 Hi, I was wondering is it possable to send an email to an address, once a file has been added to a directory? Thanks Adam Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/ Share on other sites More sharing options...
ratcateme Posted July 14, 2008 Share Posted July 14, 2008 how is the file being put i the folder. if this happens from all sorts of places you could make a cron job to go and look at the folder and compare it to last time and if there are new files send an email Scott. Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589967 Share on other sites More sharing options...
orangeparrot Posted July 14, 2008 Author Share Posted July 14, 2008 it would only be a small image, so a few kb. Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589971 Share on other sites More sharing options...
ratcateme Posted July 14, 2008 Share Posted July 14, 2008 no but how does the file get into the folder php script, other script, user Scott. Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589977 Share on other sites More sharing options...
orangeparrot Posted July 14, 2008 Author Share Posted July 14, 2008 oh sorry, yeah its a php uploader Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589981 Share on other sites More sharing options...
ratcateme Posted July 14, 2008 Share Posted July 14, 2008 then can't you put a line in it if there is a successful upload then send the email Scott. Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589989 Share on other sites More sharing options...
orangeparrot Posted July 14, 2008 Author Share Posted July 14, 2008 yeah good idea thanks, I not much good with php, how would I go about making a simple email code? thanks Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589993 Share on other sites More sharing options...
ratcateme Posted July 14, 2008 Share Posted July 14, 2008 if you are on a hosting service or you have setup mail in your php.ini this code should do it <?php mail($to,"File added to folder","a file has been added to a folder"); ?> Scott. Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-589996 Share on other sites More sharing options...
orangeparrot Posted July 14, 2008 Author Share Posted July 14, 2008 Great, Thanks for you help! Link to comment https://forums.phpfreaks.com/topic/114733-send-email-when-a-file-is-added-to-a-folder/#findComment-590000 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.