|
|
@ -360,6 +360,8 @@ public class UploadActivity extends BaseActivity { |
|
|
|
|
|
|
|
if (!editTextFilename.equals(selectedFileFilename)) { |
|
|
|
//File should be uploaded with a different name
|
|
|
|
|
|
|
|
if (checkPerms()) { |
|
|
|
if (!uploadFile.isCameraPhoto()) { |
|
|
|
//Temporarily copies the file to a another location and renames it
|
|
|
|
tempFileUri = UploadsHelper.createTempFile(this, storage, |
|
|
@ -384,6 +386,12 @@ public class UploadActivity extends BaseActivity { |
|
|
|
uploadFile.setFileUri(FileProvider.getUriForFile(this, getPackageName() + |
|
|
|
".provider", uploadFile.getPhotoFile())); |
|
|
|
} |
|
|
|
} else { |
|
|
|
requestPerms(UPLOAD_REQUEST_STORAGE_CODE); |
|
|
|
zipTask = null; |
|
|
|
dialog.cancel(); |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
Uri[] filesListArray = new Uri[filesList.size()]; |
|
|
@ -586,8 +594,9 @@ public class UploadActivity extends BaseActivity { |
|
|
|
if (previousName.isEmpty()) { |
|
|
|
uploadFilename.setText(data.getStringExtra(RESULT_FILENAME)); |
|
|
|
} else { |
|
|
|
String extractedExtension = FileUtils.getFileExtension(previousName); |
|
|
|
String filenameWithExtension = data.getStringExtra(RESULT_FILENAME) + |
|
|
|
FileUtils.getFileExtension(previousName); |
|
|
|
(extractedExtension != null ? extractedExtension : ""); |
|
|
|
uploadFilename.setText(filenameWithExtension); |
|
|
|
} |
|
|
|
hasModifiedFilename = true; |
|
|
@ -617,6 +626,8 @@ public class UploadActivity extends BaseActivity { |
|
|
|
|
|
|
|
zipTask.execute(filesListArray); |
|
|
|
finish(); |
|
|
|
} else { |
|
|
|
Toast.makeText(this, "Please retry uploading.", Toast.LENGTH_SHORT).show(); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|