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

Problem of transferring file via Skype #157

Open
tanhopham1990 opened this issue Aug 31, 2018 · 2 comments
Open

Problem of transferring file via Skype #157

tanhopham1990 opened this issue Aug 31, 2018 · 2 comments

Comments

@tanhopham1990
Copy link

tanhopham1990 commented Aug 31, 2018

Hi guys, I have a problem while running the code:

public static void sendSkypeFile(String username, String password, String identity, File file){
Skype skype = new SkypeBuilder(username, password).withAllResources().build();
try {
skype.login();
Chat chat = skype.loadChat(identity);
chat.sendFile(file);
System.out.println("File sent!");
skype.logout();
} catch (ConnectionException e) {
e.printStackTrace();
}
}

The error throws:
com.samczsun.skype4j.exceptions.ConnectionException: While uploading data (400 Bad Request) at com.samczsun.skype4j.internal.ExceptionHandler.generateException(ExceptionHandler.java:50) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:372) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.connect(Endpoints.java:302) at com.samczsun.skype4j.internal.Endpoints$EndpointConnection.post(Endpoints.java:286) at com.samczsun.skype4j.internal.Utils.upload(Utils.java:69) at com.samczsun.skype4j.internal.chat.ChatImpl.sendFile(ChatImpl.java:145)

Please show me why and how to resolve it. I will appreciate all your helps! Thanks

@metasonic
Copy link

Try having a look over this Terrance/SkPy#82
Looks like you need to add an additional header to the request

@iskrenyp
Copy link

Hi,
I am facing the same issue. Sending messages works, but not files. I am getting the same error as @tanhopham1990

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

3 participants