Skip to content

PostRequest.addFile data type File #43

@Fisch37

Description

@Fisch37

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])

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions