Akka Http所保存图像的大小为0

时间:2018-12-17 09:12:56

标签: akka-stream

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 我在做什么错误?

0 个答案:

没有答案