form粒子插件怎样安装

form粒子插件怎样安装,第1张

form粒子插件的安装非常简单,只需要以下几步:

1. 下载form粒子插件安装文件

2. 解压缩文件,将安装文件放入您的WordPress网站根目录;

3. 连接您的WordPress网站,进入插件菜单;

4. 找到form粒子插件,点击“安装”;

5. 点击“启用”按钮,安装成功。

上传:

MyjspForm mf = (MyjspForm) form// TODO Auto-generated method stub

FormFile fname=mf.getFname()

byte [] fn = fname.getFileData()

OutputStream out = new FileOutputStream("D:\\"+fname.getFileName())

Date date = new Date()

String title = fname.getFileName()

String url = "d:\\"+fname.getFileName()

Upload ul = new Upload()

ul.setDate(date)

ul.setTitle(title)

ul.setUrl(url)

UploadDAO uld = new UploadDAO()

uld.save(ul)

out.write(fn)

out.close()

下载:

DownloadForm downloadForm = (DownloadForm)form

String fname = request.getParameter("furl")

FileInputStream fi = new FileInputStream(fname)

byte[] bt = new byte[fi.available()]

fi.read(bt)

//设置文件是下载还是打开以及打开的方式msdownload表示下载;设置字湖集,//主要是解决文件中的中文信息

response.setContentType("application/msdownloadcharset=gbk")

//文件下载后的默认保存名及打开方式

String contentDisposition = "attachmentfilename=" + "java.txt"

response.setHeader("Content-Disposition",contentDisposition)

//设置下载长度

response.setContentLength(bt.length)

ServletOutputStream sos = response.getOutputStream()

sos.write(bt)

return null


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/tougao/11753979.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-18
下一篇 2023-05-18

发表评论

登录后才能评论

评论列表(0条)

保存