Hello. I have code that sends a post request to the server. Everything works well, but I need to add a file to the variables that are sent to the server. The file name and path are all there.
public SERVERPOST(Context context, URL url, Map<String, String> parameters) { super("POST", parameters, url); File root = Environment.getExternalStorageDirectory() ; File new_dir = new File(root + "/test/" + filename); String path = new_dir.getAbsolutePath(); File file = new File(path); // искомый файл postParameters.put("login", login); postParameters.put("password", password);
}
How can I add a file to two variables?