FTP Watch Program

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

FTP Watch Program

Post by LiveFree »

Hey,

Im looking for the best way to do this:

"Simply.. I want to be able to upload a JPEG file via FTP (NOT through a web browser) to a server. When the file has finished uploading, the server then sends the file out to a list of FTP and email addresses that have been previously been set up using an admin page." So the image has to be sent IMMEDIATLY after being uploaded.

Ive been thinking of creating a script that indexes a dir in FTP, then sends the images based on changes which he would have to set as a cron job that would run ever minute or so (:S)

Ideas?

Thanks
User avatar
wtf
Forum Contributor
Posts: 331
Joined: Thu Nov 03, 2005 5:27 pm

Post by wtf »

That should work. I've worked on photography site project where an ftp account would be created with each membership allowing them to upload files via FTP. We needed to know when the file is done FTPing and the only way to find that out is by reading the directory structure, saving the info then reading it again in order to compare file sizes. If the file size is the same, it would be assumed that the FTP on that specific file is done and the file would be moved from ftp directory to "some directory" which is something you should consider since it makes no sense comparing the files over and over.

so, anyway, that can work.

You may also want to consider using http://www.proftpd.org since it doesn't require creation of system user account in order to FTP files.
Post Reply