Question

I got an issue with transferring MP3 format or wav format from local to FTP. The music got distorted or even blank sounds.

I used session.storbinary('STOR '+ fileName, fileOpen) which causes the sound distortion. Is there any other way to transfer the files over? Or I have to do it manually?

I'm using python with ftplib.

Was it helpful?

Solution

Make sure to open your local files like this:

f = open('something.mp3', 'rb')

Using open('asd.mp3') will treat the file as text and result in corruption. Now, I can't be sure this is the problem, but without more context this is my closest bet.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top