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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:29:00+00:00 2026-06-17T06:29:00+00:00

I’m attempting to use the ftplib library in Python to try and FTP some

  • 0

I’m attempting to use the ftplib library in Python to try and FTP some videos to my website. I’ve got a script with the basics “working”, but there’s a problem with it. When I try to play my video back using VLC player, it appears that it’s corrupt, as it only plays the first 15 seconds of video (probably until some important keyframe in the video, but that’s likely besides the point) and then the audio only sometimes continues.

The strange thing about it is that if I perform an ls -l on both the local directory and the remote directory, the filesizes are the same (even though the Mac locally calculates the filesize as 75.6 MB while the cPanel File Manager shows it as only 71.2 MB). To double-check, the MD5 checksums on both ends also came out to be the same. But clearly, the data isn’t entirely right on the server side. Odds are, I’m probably not opening the .mov file correctly in my Python script, as it took me a little while just to wrap my head around file and file-like objects (meaning I probably still have it wrong).

This is my current upload script:

#!/usr/bin/env python

import os
from ftplib import FTP

# Log in to the FTP server
ftp = FTP('campusweatherservice.com')
ftp.login('myusername', 'mypassword')

# Change directories to the intended video source
os.chdir('/Users/cws/Desktop/CNET')

f = file('cnet.mov', 'rb')         # Currently opening the file as a file object
ftp.storbinary('STOR CNET.mov', f) # We then try to store it this way

# Close our file object and then quit the FTP client
f.close()
ftp.quit()

Any thoughts or obvious mistakes on my end here? If you’d like to try the video file for yourself, it’s at http://www.campusweatherservice.com/CNET/CNET.mov

  • 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-17T06:29:02+00:00Added an answer on June 17, 2026 at 6:29 am

    So hopefully you can see from the comments on the original question that this issue was a matter of testing, not the code.

    Lessons learned here:

    1. If your checksums match, make damn sure your files aren’t in fact, identical. That’s 1000x more likely to be the case than some weird fringe case (as I originally figured it was)
    2. If you provide an actionable item in your Stack Overflow post (like ‘download my video to see for yourself’), you should probably test that out yourself.

    So I guess this question is now at least good as a) a reference for uploading files via FTP using Python and b) a good lesson on asking questions on Stack Overflow!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am confused How to use looping for Json response Array in another Array.
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.