I need to upload audio files recorded from my application .I am unable to upload aac files to ftp. Here is my code to upload
FtpWebRequest ftp = (FtpWebRequest)FtpWebRequest.Create(myftppath);
ftp.Credentials = new NetworkCredential(username,password);
ftp.UseBinary = true;
ftp.Method = WebRequestMethods.Ftp.UploadFile;
FileStream fs = File.OpenRead(audioFilePath);
byte[] buffer = new byte[fs.Length];
fs.Read(buffer, 0, buffer.Length);
fs.Close();
Stream ftpstream = ftp.GetRequestStream();
ftpstream.Write(buffer, 0, buffer.Length);
ftpstream.Close();
ftpstream.Flush();
The code works for uploading other files like txt,png,mp3 etc but not for aac files. Please help
Your code seems to be correct. You may try this,
If none works then find out the exact cause of error using try block.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.