Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8506683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:39:26+00:00 2026-06-11T02:39:26+00:00

I need to upload a file to my FTP server using cURL. let me

  • 0

I need to upload a file to my FTP server using cURL. let me explain better.

I have this URL http://www.server.com/file.zip and I need to copy the “file.zip” to a FTP server without having to download it to my PC.

I have seen some examples that use cURL to upload files but are they are my hard drive and I need is upload from a URL.

Thank you for your help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:39:28+00:00Added an answer on June 11, 2026 at 2:39 am

    Since you don’t know if you’re saving it properly, just use the stream.

    <?php
    
    // open some file for reading
    $file = 'http://server.com/file.zip';
    $fp = fopen($file, 'r');
    
    // set up basic connection
    $conn_id = ftp_connect($ftp_server);
    
    // login with username and password
    $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
    
    // try to upload $file
    if (ftp_fput($conn_id, $file, $fp, FTP_ASCII)) {
        echo "Successfully uploaded $file\n";
    } else {
        echo "There was a problem while uploading $file\n";
    }
    
    // close the connection and the file handler
    ftp_close($conn_id);
    fclose($fp);
    
    ?>
    

    By the way, I’m just using PHP Manual examples for these answers. You should, too. Look here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to upload a file using ftp or http. I checked downloading from
I'm using FTPClient (org.​apache.​commons.​net.​ftp.​FTPClient) to upload some files to a FTP server. I need
I need to upload a file in C# using an httpwebrequest. I don't need
I need to upload .dat file from jsp page. I am using struts. I
i am developing register form using php where i need to upload the file
I need to upload a xml file from server side, where the contents of
I need to upload a csv file to a server. works fine for smaller
I need to upload a directory having sub-directories to a ftp server. I can
I'm using the Java URL and URLConnection classes to upload an file to a
I need to continuously upload a generated file from Azure to client's FTP but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.