简体   繁体   English

使用 Play 将文件上传到 GAE! 框架

[英]Uploading a file to GAE with Play! Framework

What is the best way of uploading files to Google App Engine Blobstore with Play, Framework?使用 Play、Framework 将文件上传到 Google App Engine Blobstore 的最佳方式是什么? using Siena and GAE module?使用 Siena 和 GAE 模块?

I have tried declaring a Blob field in my Model:我尝试在我的 Model 中声明一个 Blob 字段:

public Blob image;

And a method to attach the file:以及附加文件的方法:

public void attachImage(byte[] bytes) {
    this.image = new Blob(bytes);
}

I don't really know how to test this since the CrudSiena module doesn't display an upload field.我真的不知道如何测试这个,因为 CrudSiena 模块不显示上传字段。 Any help much appreciated.非常感谢任何帮助。

Blob is a type managed by GAE datastore but it's different from GAE Blobstore! Blob 是一种由 GAE 数据存储管理的类型,但它与 GAE Blobstore 不同!

If you use byte[] instead of Blob in your model, does it work with CrudSiena?如果您在 model 中使用 byte[] 而不是 Blob,它是否适用于 CrudSiena?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM