You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Morten Andersen <mo...@mip.sdu.dk> on 2004/06/15 16:19:50 UTC

commons.net FTP upload corrupts video-files

I am trying to make an automatic upload from a web-server to a 
media-streaming server of streaming videos. This fails. The files seems to 
get corrupted. I don't know why:
Here is some of the code:
--------------------------------------------------

  InputStream input = new FileInputStream(file);
  ftp.setFileTransferMode(FTPClient.BINARY_FILE_TYPE);
  ftp.storeFile("TEST-FILE.wmv", input);

---------------------------------------------------
ftp is a FTPClient and the file I'm uploading is a "wmv" file.

The file gets uploaded but as I try to download it and play it Windows 
media player argues that the file is corrupted.

The uploaded file is 800 bytes bigger then the original.

Please advice...


Morten Andersen
Master of applied mathematics and computer science
Amanuensis
Interest areas:
   -e-learning
   -software engineering
   -applied math

The Maersk Institute of Production technology at Southern Danish University 
www.mip.sdu.dk
Campusvej 55
DK-5230 Odense M
Denmark
+45 65 50 36 54
+45 61 71 11 03
Jabber id: hat@jabber.dk


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Re: commons.net FTP upload corrupts video-files

Posted by Morten Andersen <mo...@mip.sdu.dk>.
I solved the problem using setFileType(...) instead of setTransferType(...).

I think its a bug.

Morten Andersen


At 16:19 15-06-2004, you wrote:
>I am trying to make an automatic upload from a web-server to a 
>media-streaming server of streaming videos. This fails. The files seems to 
>get corrupted. I don't know why:
>Here is some of the code:
>--------------------------------------------------
>
>  InputStream input = new FileInputStream(file);
>  ftp.setFileTransferMode(FTPClient.BINARY_FILE_TYPE);
>  ftp.storeFile("TEST-FILE.wmv", input);
>
>---------------------------------------------------
>ftp is a FTPClient and the file I'm uploading is a "wmv" file.
>
>The file gets uploaded but as I try to download it and play it Windows 
>media player argues that the file is corrupted.
>
>The uploaded file is 800 bytes bigger then the original.
>
>Please advice...
>
>
>Morten Andersen
>Master of applied mathematics and computer science
>Amanuensis
>Interest areas:
>   -e-learning
>   -software engineering
>   -applied math
>
>The Maersk Institute of Production technology at Southern Danish 
>University www.mip.sdu.dk
>Campusvej 55
>DK-5230 Odense M
>Denmark
>+45 65 50 36 54
>+45 61 71 11 03
>Jabber id: hat@jabber.dk
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org