Skip to content

Commit

Permalink
change upload field name to file.
Browse files Browse the repository at this point in the history
  • Loading branch information
rockgecko-development committed Mar 12, 2017
1 parent 5be43f8 commit 9daa5b9
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ protected Void doInBackground(Interview... params) {
String url = "https://slack.com/api/files.upload?token="+slackToken+"&channels="+slackChannel+"&initial_comment="+slackMsg;
*/
//doFileUpload(url, destinationFile, destinationFileName);
doFileUpload("interviews", destinationFile, destinationFileName, interview);
doFileUpload("api/v1/upload_interview", destinationFile, destinationFileName, interview);
}
}
}
Expand Down Expand Up @@ -308,13 +308,13 @@ private String doFileUpload(String urlPath, File file, String shortName, Intervi
conn.setRequestMethod("POST");
//conn.setRequestProperty("Connection", "Keep-Alive");
//conn.setRequestProperty("ENCTYPE", "multipart/form-data");
conn.setRequestProperty("Content-Type", "multipart/form-data; boundary="+boundary);
conn.setRequestProperty("Content-Type", "multipart/form-data; charset=utf-8; boundary="+boundary);
//conn.setRequestProperty("uploaded_file", shortName);
dos = new DataOutputStream( conn.getOutputStream() );
dos.writeBytes(twoHyphens + boundary + lineEnd);
writeInterviewMultipartFormFields(interview, dos, boundary);
dos.writeBytes(twoHyphens + boundary + lineEnd);
dos.writeBytes("Content-Disposition: form-data; name=\"interview[zipfile]\"; filename=\"" + shortName + "\"" + lineEnd);
//writeInterviewMultipartFormFields(interview, dos, boundary);
//dos.writeBytes(twoHyphens + boundary + lineEnd);
dos.writeBytes("Content-Disposition: form-data; name=\"file\"; filename=\"" + shortName + "\"" + lineEnd);
dos.writeBytes("Content-Type: application/zip" + lineEnd);
dos.writeBytes(lineEnd);
// create a buffer of maximum size
Expand Down

0 comments on commit 9daa5b9

Please sign in to comment.