AtomicRax Posted February 2, 2011 Share Posted February 2, 2011 I'm not asking for specific coding help, but what I am looking for is an answer from someone who might have dealt with this in the past and can help shed some light on the subject. I'm working on a website that allows the user to upload several images at a time. I have serverA that hosts the website and database and serverB that hosts the image uploads. I'm looking for the best (preferably the fastest) method to transfer image files from serverA to serverB. I know I can transfer the files through FTP in PHP and I can also do it via HTTP by making a small script on serverB that would accept _POST transfers of each file.. Are there other methods? Remember, there are 2-3 images sent each time.. so just because a method might be "preferred," I don't want to make the user wait longer than they have to. Thanks for your time. Link to comment https://forums.phpfreaks.com/topic/226501-best-method-to-transfer-files/ Share on other sites More sharing options...
BlueSkyIS Posted February 2, 2011 Share Posted February 2, 2011 FTP/SFTP would probably be the fastest and simplest to code. Link to comment https://forums.phpfreaks.com/topic/226501-best-method-to-transfer-files/#findComment-1169070 Share on other sites More sharing options...
AtomicRax Posted February 2, 2011 Author Share Posted February 2, 2011 That's what I was thinking, since it's actually meant for file transfers, but I just wanted to make sure. Thanks! And for others who are curious, here's two snippets I found online at http://davidwalsh.name/send-files-ftp-php $connection = ftp_connect($server); $login = ftp_login($connection, $ftp_user_name, $ftp_user_pass); if (!$connection || !$login) { die('Connection attempt failed!'); } $upload = ftp_put($connection, $dest, $source, $mode); if (!$upload) { echo 'FTP upload failed!'; } ftp_close($connection); $upload = copy($source, 'ftp://user:password@host/path/file'); if (!$upload) { echo 'FTP upload failed!'; } Link to comment https://forums.phpfreaks.com/topic/226501-best-method-to-transfer-files/#findComment-1169081 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.