00stuff Posted September 29, 2011 Share Posted September 29, 2011 Hi guys, I have a website that I created and it has the ability to upload images to a directory that is located in the same web server, but there are so many images now and it is taking too much space. What I am trying to do now is for the script to upload the images to a different server but don't want to run FTP on that second server if I don't need to. Does anyone know how I can do that? Thank you guys in advanced, Quote Link to comment https://forums.phpfreaks.com/topic/248128-uploading-images-with-php-from-webserver-a-to-server-b/ Share on other sites More sharing options...
Jacbey Posted September 29, 2011 Share Posted September 29, 2011 You need to use FTP to transfer any kind of file over php to a web server. Sorry to disappoint. Quote Link to comment https://forums.phpfreaks.com/topic/248128-uploading-images-with-php-from-webserver-a-to-server-b/#findComment-1274142 Share on other sites More sharing options...
00stuff Posted September 29, 2011 Author Share Posted September 29, 2011 Well, I know it has to be uploaded with FTP, but I don't want to run an FTP server on the server that will contain the images and the server receiving the images is not a web server either. Just a computer with its own ip. Any way to do that? This is what I was doing. // get file attributes!!!!! $photoname1 = $_FILES['img_file']['name']; $tmp_name1 = $_FILES['img_file']['tmp_name']; $random1 = rand(1, 1000000); if ($photoname1) { // start upload process $photoname1 = $report_id . "_" . $random1 . "_" . $photoname1; // $location1 = "record_images/$photoname1"; $location1 = "http://192.168.1.3/qcapp_images/$photoname1"; move_uploaded_file($tmp_name1,$location1); } else { $location1 = ""; } Quote Link to comment https://forums.phpfreaks.com/topic/248128-uploading-images-with-php-from-webserver-a-to-server-b/#findComment-1274144 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.