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 File - How to ? #7

Closed
Yadasko opened this issue Dec 7, 2014 · 2 comments
Closed

Upload File - How to ? #7

Yadasko opened this issue Dec 7, 2014 · 2 comments

Comments

@Yadasko
Copy link

Yadasko commented Dec 7, 2014

Hi !
I just discovered your project thanks to your post on stackExchange.
I want to upload a File to a server, and save it.

For now, I've got this code :

    Webb webb = Webb.create();
    Response<String> response = webb
            .post("http://..../test.php")
            .body(file)
            .connectTimeout(10 * 1000)
            .asString();

    if (response.isSuccess()) {
        String outcome = response.getBody();
        System.out.println(outcome);

    } else {
        System.out.println(response.getStatusCode());
        System.out.println(response.getResponseMessage());
        System.out.println(response.getErrorBody());
    }

My question is : How can I receive this file in the PHP Script ?
Do I need to look for something like $_FILES or $_POST ?

@Yadasko
Copy link
Author

Yadasko commented Dec 7, 2014

Nevermind, I don't want to make you lose time :D
Thanks for the library, it works perfectly !

@Yadasko Yadasko closed this as completed Dec 7, 2014
@hgoebl
Copy link
Owner

hgoebl commented Dec 8, 2014

Seems like this is not much of a problem:

You're welcome!

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

2 participants