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