I have a python project, it records an audio from usb microphone and save it to OGG file and upload to FTP server. But file stored in server can not be opened and capacity of file in server is different with in device. But everything is okay with WAV audio file. Can anyone help me to find solution to this problem? Here is my ftp upload function

def uploadFile(filename):

    print("start uploading file: " + filename)
    # connect to container
    ftp = ftplib.FTP(config.ftp_server_ip, config.username, config.password)

    # write file
    ftp.storbinary('STOR '+filename, open(filename, 'rb'))
    # close connection
    print("finished uploading: " +filename)

0 Answers