def insertPhoto(databaseDataProvider: DatabaseDataProvider, imagepath: String, data: Source[akka.util.ByteString, Any], token: String, event_id: String) = {
var savefile = imagepath
val dbuser = databaseDataProvider.existToken(token)
if (dbuser.get != null) {
val vyrobnicislo = dbuser.get.vyrobnicislo
val iddb = dbuser.get.iddatabase
val podtrzitko = "_"
savefile = s"$savefile\\$vyrobnicislo\\doc$iddb$podtrzitko$event_id.jpg"
implicit val materializer = ActorMaterializer.create(cz.evotech.QuickstartServer.system)
val file = Paths.get(savefile)
data.runWith(FileIO.toPath(file))
}
}
已保存图像的大小为0 我在做什么错误?