Jump to content

Uploading images with php from webserver A to Server B


00stuff

Recommended Posts

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,

Link to comment
Share on other sites

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 = "";
				}

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.