关于使用该框架来让Android设备作为Server接收文件的问题?
soyoungboy opened this issue · 1 comments
soyoungboy commented
public class WeChatController {
public static final String OK = "上传成功";
@ResponseBody
@RequestMapping("upload")
public NanoHTTPD.Response upload(NanoHTTPD.IHTTPSession session) {
FFileUploadUtils.uploadFile(session, FFileUtils.getRootDir(), "file");
return NanoHTTPDUtil.setResponse(NanoHTTPD.Response.Status.OK, OK);
}
}
Application里面:
/**
* 启动HttpServer
*/
private fun initFHttpManager() {
fHttpManager = FHttpManager.init(this, WeChatController::class.java)
.setPort(9999)
.setAllowCross(true)
.startServer()
}
如上代码来让Android设备作为Server接收文件,但是我用postman测试上传无法ok,不知道有什么特殊的写法或者配置?
570622566 commented