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 7612645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T01:57:58+00:00 2026-05-31T01:57:58+00:00

I am uploading a large file by SFTP over Jsch. During the upload process,

  • 0

I am uploading a large file by SFTP over Jsch. During the upload process, the old file should be available, so I’m uploading to a temp file and rename it to the new file.

final String tmpName = dest + "_tmp";
channel.put(source, tmpName);
channel.rename(tmpName, dest);

The upload is ok but the renaming fails:

ERROR: Failed to upload files
4: Failure
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2491)
at com.jcraft.jsch.ChannelSftp.rename(ChannelSftp.java:1665)
    ...

I can’t figure out where the problem is. Please 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-05-31T01:58:00+00:00Added an answer on May 31, 2026 at 1:58 am

    The target file already exists. Try deleting the existing file before renaming.

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

Sidebar

Related Questions

When is PostedFile.InputStream available when uploading a large file? I'd like to pass a
I have a large directory which I need to upload to a new host's
I'm uploading a fairly large file with urllib2 to a server-side script via POST.
I have a large file I'm uploading. The entire request can take more than
My site uses nginx. I use apache only for large file uploading to the
I'm trying to upload large file (>100Mb) using Apache commons-net FTP library to Secure
When uploading a file (jpeg) via a form in IE7 I am seeing a
While user uploading a file, is it possible to know if the uploaded file
I want to provide a progress bar for my users who upload very large
i'm uploading a 70mb ZIP file . perhaps debugging may be putting things out

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.