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

PostRequest.addFile data type File #43

Open
Fisch37 opened this issue Jan 23, 2021 · 0 comments
Open

PostRequest.addFile data type File #43

Fisch37 opened this issue Jan 23, 2021 · 0 comments

Comments

@Fisch37
Copy link

Fisch37 commented Jan 23, 2021

It may just be that I am stupid and maybe missed something, but I've run into a problem with the addFile command. It requires a File datatype, but I am unaware on how to get those.

What I am trying to do is to upload a JPEG File to my server via a post request. For that I have this code:

void keyReleased() {
  PImage img = get();
  img.save(fileName);
  PostRequest post = new PostRequest(upload_Skript_Address);
  post.addFile("file",someFile); //needs File type object (What datatype is that? Where do I get it?)
  post.send();
  println("Reponse Content: " + post.getContent());
  println("Reponse Content-Length Header: " + post.getHeader("Content-Length"));
}

But as you may read, I need a File object which I don't know how to get. Do please help if you have any idea (even if it was a only a Google search away [though that would be quite embarassing])

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

1 participant