Wouldn't it be handy to have: ```suspend fun Appli...
# ktor
d
Wouldn't it be handy to have:
Copy code
suspend fun ApplicationCall.receiveFile(uploadDir: String): File =
		receiveMultipart().readPart().let {
			if (it is PartData.FileItem) {
				val ext = File(it.originalFileName).extension

				File(uploadDir, "upload-${System.currentTimeMillis()}-${it.originalFileName!!.hashCode()}.$ext").also { file ->
					it.streamProvider().use { its -> file.outputStream().buffered().use { its.copyTo(it) } }
				}
			} else error("Error retreiving upload")
		}
For easy one-file upload handling?