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

Upload PDF file not successful #1

Open
tranngoclinh88 opened this issue Jan 11, 2015 · 6 comments
Open

Upload PDF file not successful #1

tranngoclinh88 opened this issue Jan 11, 2015 · 6 comments

Comments

@tranngoclinh88
Copy link

I tried uploading a pdf file to my ftp server. Application notify that uploading is successful but I can not open the uploaded file and uploaded file size is small than local file.

@DeveloperLx
Copy link
Owner

Thank you for your attention. Maybe my notification has some error, and the phenomenon you see is because of the network problem. I'm busy recently, I want to fix it some other day. Thanks for your supporting again !

@DeveloperLx DeveloperLx reopened this Jan 13, 2015
@gurinderhans
Copy link

This happens with even a regular ~10KB png file.

@tranngoclinh88
Copy link
Author

It's OK with png file.

@gurinderhans
Copy link

I went in and started logging bytes written vs read and those things. All those seem fine however my png file that is 7118 bytes only gets uploaded up-to 4520 bytes. Another image 226595 bytes, only 141000 bytes get uploaded. But the weird thing is the logs show everything well. I will try looking more at the source code myself later but it'd be great if a fix could be put up :D

@gurinderhans
Copy link

Seems like calling [request stop]; in the condition (bytesRead == 0) causes this issue, as this closes the stream but all of the data still hasn't been uploaded yet.

Why does this not get called? kCFStreamEventEndEncountered
The whole problem would be solved then. Until then I'm manually gonna have to close the stream from somewhere.

@dolce-ardore
Copy link

I was also getting randomly truncated uploads until I found the magic line to remove:

679: CFWriteStreamSetProperty(self.writeStream, kCFStreamPropertyFTPAttemptPersistentConnection, kCFBooleanFalse);

After commenting out this line, all my uploads appear to be complete.

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