Aresk Posted March 13, 2012 Share Posted March 13, 2012 I want to upload a file automatically at any time from my home PC to a website I am developing. I can upload OK using a form with 'enctype="multipart/form-data"' but this requires manual operation to select a file and to submit the upload request. Is there a way the upload process can be made to happen with no operator present? I also want to download from the website to my PC automatically ie. download a file (as it becomes available) from the website to a specified location on my PC, without operator intervention. Help. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/ Share on other sites More sharing options...
scootstah Posted March 13, 2012 Share Posted March 13, 2012 I'm sure you could use a cron job to do both of these tasks. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1326869 Share on other sites More sharing options...
Psycho Posted March 13, 2012 Share Posted March 13, 2012 Well, a cron job would only work if you also ran a web server on your home PC and the cron job ran there. The remote web server cannot push/pull files from your home PC, your home PC will have to do the work. I think there are probably plenty of solutions that have nothing to do with PHP. I would look for a utility that will sync files via FTP and run that on your home PC. I know that such utilities will sync local files to a remote location, but I've never tried to see if they will sync files from a remote location to a local one, but I wouldn't see why there wouldn't be such an option. You could start by looking at SyncBack: http://www.2brightsparks.com/syncback/index.html Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1326883 Share on other sites More sharing options...
Psycho Posted March 13, 2012 Share Posted March 13, 2012 I just checked my version of SyncBackSE and it does support backing up TO an FTP server as well as backing up FROM an FTP server. So, you could have two separate backups scheduled - one to bring down new files from the server and one to put new ones on the FTP server. Or, if the files to be transferred between the two are in a single location on both machines you could set up a sync. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1326894 Share on other sites More sharing options...
scootstah Posted March 13, 2012 Share Posted March 13, 2012 Well, a cron job would only work if you also ran a web server on your home PC and the cron job ran there. The remote web server cannot push/pull files from your home PC, your home PC will have to do the work. I think there are probably plenty of solutions that have nothing to do with PHP. I would look for a utility that will sync files via FTP and run that on your home PC. I know that such utilities will sync local files to a remote location, but I've never tried to see if they will sync files from a remote location to a local one, but I wouldn't see why there wouldn't be such an option. You could start by looking at SyncBack: http://www.2brightsparks.com/syncback/index.html I was thinking using a cron job to run a PHP script with FTP commands. But, you're right, if you're going that route PHP probably isn't the best option. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1326931 Share on other sites More sharing options...
Aresk Posted March 14, 2012 Author Share Posted March 14, 2012 Thanks. Valuable advice. I conclude the solution lies in using ftp somehow on my home computer leaving me with a steep learning curve but at least on the right track. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1327182 Share on other sites More sharing options...
Psycho Posted March 14, 2012 Share Posted March 14, 2012 Thanks. Valuable advice. I conclude the solution lies in using ftp somehow on my home computer leaving me with a steep learning curve but at least on the right track. Steep learning curve? I think you are making it more difficult than it needs to be. There are utilities (such as SyncBack) that will do all the work for you. There is even a free version of SyncBack, but I'm not sure if it allows for FTP. But, even the SE version is relatively cheap. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1327313 Share on other sites More sharing options...
scootstah Posted March 14, 2012 Share Posted March 14, 2012 Maybe this will be of some help: http://winscp.net/eng/docs/guide_automation Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1327316 Share on other sites More sharing options...
Psycho Posted March 14, 2012 Share Posted March 14, 2012 Maybe this will be of some help: http://winscp.net/eng/docs/guide_automation Nice. I actually use WinSCP and never knew it had that functionality. Yet another option. Quote Link to comment https://forums.phpfreaks.com/topic/258838-automatic-upload/#findComment-1327453 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.