Skip to content

Commit

Permalink
Changed directory for uploading files.
Browse files Browse the repository at this point in the history
  • Loading branch information
mhenman committed Mar 7, 2020
1 parent 5790c3c commit c39950e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void run() {
charsRead += in.read(buffer, charsRead, length - charsRead);
}
if (charsRead == length) {
File myDir = getDataDirectory();
File myDir = getUploadDirectory();
File outFile = new File(myDir, filename);
writeFile(outFile, new String(buffer));
}
Expand Down Expand Up @@ -308,6 +308,13 @@ public static File getDataDirectory() {
return myDir;
}

public static File getUploadDirectory() {
File directory = Environment.getExternalStorageDirectory();
File myDir = new File(directory + "/Documents");
myDir.mkdirs();
return myDir;
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
Expand Down

0 comments on commit c39950e

Please sign in to comment.