[Media upload] Upload image, video and files (#411)
* Add media upload * Display media upload error messages using a Snackbar.
This commit is contained in:
committed by
GitHub
parent
6a2cb1bbb5
commit
ed16ea5e48
@@ -37,6 +37,7 @@ fun File.safeDelete() {
|
||||
)
|
||||
}
|
||||
|
||||
suspend fun Context.createTmpFile(baseDir: File = cacheDir): File = withContext(Dispatchers.IO) {
|
||||
File.createTempFile(UUID.randomUUID().toString(), null, baseDir).apply { mkdirs() }
|
||||
suspend fun Context.createTmpFile(baseDir: File = cacheDir, extension: String? = null): File = withContext(Dispatchers.IO) {
|
||||
val suffix = extension?.let { ".$extension" }
|
||||
File.createTempFile(UUID.randomUUID().toString(), suffix, baseDir).apply { mkdirs() }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user