Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't upload a binary file #36

Open
divoneimacedo opened this issue May 2, 2024 · 5 comments
Open

Can't upload a binary file #36

divoneimacedo opened this issue May 2, 2024 · 5 comments

Comments

@divoneimacedo
Copy link

divoneimacedo commented May 2, 2024

Hello people, does anyone have the same problem than me? I cant upload a binary file like .jpg always i tried the file is corrupted in ftp server.

@tototo23
Copy link

tototo23 commented May 16, 2024

I have the same issue and just understood what happened !

On binary data like JPEG, I compared what i sent, and what the server recevied.
The server recevied always just few bytes less, even if logs said it's all sent :

I then compared binary and discovered that in the JPEG file there are sometimes the bytes sequences 0x0D0A, that is written on the FTP side as only 0x0A... Cause yeah,in textual mode, it's like replacing CRLF by just LF. But it's not what we want especially in binary files ! So if you search the CRLF occurrences in your JPG files, you'll get the size difference between your original binary file and the corrupted one, that has lost the CR char.

But i don't know if it is a bug from the library itself or an other level. But as it works with other tools, for sure it's a bug somewhere.

@samfilholima
Copy link

Hello, I am experiencing the same problem, but specifically with downloads. One thing I've noticed is that for files smaller than 600KB, the process works normally. However, for larger files, some bytes seem to be missing

@divoneimacedo
Copy link
Author

divoneimacedo commented May 17, 2024

Hey Guys, finally my code is working with the FTP its just a configuration on options lib. Now i can send binaries files.
here is the code :
await ftpClient.setTransferType(TransferType.binary);
Thank you all =)

@tototo23
Copy link

Oh @divoneimacedo super nice! Thanks a lot ! It'll help some of us, I didn't see this option, that makes sense !

@ismanong
Copy link

@divoneimacedo thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants