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

  • Home
  • SEARCH
  • 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 7800077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:31:03+00:00 2026-06-02T00:31:03+00:00

Is it possible to upload a file into a subfolder on an FTP server?

  • 0

Is it possible to upload a file into a subfolder on an FTP server?

I send a file daily to an FTP server, scheduled on a cron job that runs a php file. It all works fine, but now I’ve been asked to change the destination to a subfolder.

Changing *$server_name = ‘ftp.website.com’* to *$server_name = ‘ftp.website.com/data’*
doesn’t seem to work?

I can see the folder exists in filezilla and it has all read/write access in permissions.

I’d be grateful if someone can advise if its a permission issue or whether it’s possible at all?

Thanks in advance.

CODE…

//FTP bit...

$server_name        = 'ftp.website.com';
$server_username    = 'xxxx';
$server_password    = 'xxxx';
$conn_id = ftp_connect($server_name);
$login_result = ftp_login($conn_id, $server_username, $server_password);
ftp_pasv($conn_id, true);
ftp_put($conn_id, $zip_filename, $output_dir . $zip_filename, FTP_BINARY);
  • 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-02T00:31:04+00:00Added an answer on June 2, 2026 at 12:31 am

    Seems like you need to use ftp_chdir().

    Connect as normal, and then change directories using ftp_chdir().

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

Sidebar

Related Questions

Is it possible to upload a file to another server or pass a file
Possible Duplicate: how to upload a audio file from iphone documents folder to server
I need a way to upload a file and POST it into php page
is it possible to upload a file and subsequently when receiving response download the
Is it possible to upload an audio file (i.e. mp3, flac...) to the the
Is it possible to upload a .zip file to iCloud , and then have
Possible Duplicate: how to upload folder with php I know we can upload single
Possible Duplicate: How can I only allow certain filetypes on upload in php? i'm
Is it possible for Uploadify to send out e-mail confirmation after the upload? Uploadify
Let's say that I have a file (file1.php) with a simple form with the

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.