I looked at a CDN and found i need to use SFTP to upload files to it. Using sftp isnt to difficult but how do i continuously upload files? my webapp current puts apps in /uploads/type/01/02/03/04/05/06/07/08.ext when the file id is 0x0102030405060708
How do i upload these files? do i launch sftp everytime a user uploads a file? is there some kind of deamon mode i can use to monitors when i add something to uploads and uses sftp on it? I was thinking about using cron but i dont want to check if thousands of files exist everytime. Also what happens when the connection has been terminated (lets say i restart my server for maintenance reasons). I dont know whats the easiest way to have everything work.