文件上传错误nanohttpd [英] file uploading error nanohttpd

查看:1038
本文介绍了文件上传错误nanohttpd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用低于code上传使用NanoHTTPD文件,但没有什么是被上载,也没有给我临时路径。

I used below code to upload files using NanoHTTPD, but nothing is being uploaded nor giving me temp path.

code是:

new Response(
    HTTP_OK,
    MIME_HTML,
    "<html><body><form name='up' enctype='multipart/form-data'><input type='file' name='file' /><br /><input type='submit'name='submit' value='Upload'/></form></body></html>"
);

我获得成功上传页面,并点击上传按钮后,我的网址也变为

I am successfully getting upload page, and after clicking on upload button, my URL is also changing to

http://IP_ADD:PORT/file?file=closed.png&submit=Upload

但没有什么是上传到我的电话。

But nothing is uploading to my phone.

你能帮帮我吗?

推荐答案

下面是解决方案

new Response(HTTP_OK, MIME_HTML, "<html><body><form name='up' method='post' enctype='multipart/form-data'><input type='file' name='file' /><br /><input type='submit'name='submit' value='Upload'/></form></body></html>");

您需要只需要添加 =法后形式。

You need to just add method='post' in form.

这篇关于文件上传错误nanohttpd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆