Jump to content

Recommended Posts

Hey guys,

 

Just having some issues with my basic FTP script (again). I had to move the script to a new webserver which runs the last version of PHP5.

 

The code was created and tested using PHP4. And all was good. However on the new server i can seem to get ftp_put to work for me.

 

// upload the file
      $upload = ftp_put($conn_id, $destination_file, $file, FTP_BINARY);

      // check upload status
      if (!$upload) {
          echo "<br />FTP upload of has failed!<br />";
          exit();

// if upload worked, delete the folder off the local webhost
      } else {
          echo "<p>Uploading Complete!</p><br /><br />";
	  recursive_remove_directory($directory, $empty=FALSE);
      }

 

The code fails at the f (!$upload) statement obviously. This is strange because i can create a connection, AND create a directory on the remote host. But i just cant send the file. The $file and $destination_file variables are all correct. I literally just went from PHP4 to PHP5 and it stopped working. Any suggestions?

 

Cheers,

/Rhys

Link to comment
https://forums.phpfreaks.com/topic/52926-more-ftp-issues/
Share on other sites

  • 2 months later...
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.