java上传图片到ftp

Windows Server上OpenVPN 2.4.8双因子认证实战:账号密码+证书,附一键脚本 本文详细介绍了在Windows Server上部署OpenVPN 2.4.8双因子认证(账号密码+证书)的实战方案,包括架构设计、证书体系规划、环境准备、服务器端配置及客户端自动化部署。通过一键脚本和优化配置,提升企业VPN的安全性和运维效率,特别适合金融、医疗等对安全性要求高的行业。 阅读详情

 最近在弄新闻编辑后台的管理程序,由于公司没有图片服务器,后台的程序和前台的程序分离。前台和后台都是部署在集群上。要想共享上传的图片,我们在每台机器上开了个ftp。在提交的时候同时将文件上传到ftp上。

 

页面展示选择了kindEdit   js框架。

 

上传本地图片到服务器的程序如下:

 

<%@ page pageEncoding="gbk"%>
<%@page
 import="java.util.*,java.io.*,  
    org.apache.commons.fileupload.FileItem,  
    org.apache.commons.fileupload.FileUploadException,  
    org.apache.commons.fileupload.disk.DiskFileItemFactory,  
    org.apache.commons.fileupload.servlet.ServletFileUpload,  
    java.util.concurrent.locks.*,
    com.glot.csp.lottery.common.ftp.*"%>
<%  
    String id = "";  
    String url = "";  
    String imgTitle = "";  
    String imgWidth = "";  
    String imgHeight = "";  
    String imgBorder = "";  
    String filePath = "";  
    String align = "";  
    // **************************************  
    // 初始化上传工厂对象  
    DiskFileItemFactory factory = new DiskFileItemFactory();  
    // 设置上传工厂对象限制  
    factory.setSizeThreshold(1024 * 1024 * 20);  
    factory.setRepository(new File(request.getSession(true)  
            .getServletContext().getRealPath("/")));  
    // 创建上传对象  
    ServletFileUpload upload = new ServletFileUpload(factory);  
    upload.setFileSizeMax(1024 * 1024 * 20);  
    List items = null;
    System.out.println("*************MMMM&&&&&&&&&"); 
    try {  
        items = upload.parseRequest(request);  
    } catch (FileUploadException e) {  
        e.printStackTrace(System.out);  
    }  
    for (Iterator i = items.iterator(); i.hasNext();) {  
        FileItem item = (FileItem)i.next();  
        if (item.isFormField()) {  
            String name = item.getFieldName();  
            String value = item.getString("gbk");  
            if (name.equals("id")) {  
                id = value;  
            } else if (name.equals("imgTitle")) {  
                imgTitle = value;  
            } else if (name.equals("imgWidth")) {  
                imgWidth = value;  
            } else if (name.equals("imgHeight")) {  
                imgHeight = value;  
            } else if (name.equals("imgBorder")) {  
                imgBorder = value;  
            } else if (name.equals("align")) {  
                align = value;  
            } else if (name.equals("url")) {  
                filePath = value;  
            }  
        } else {  
            // 取得表单域名  
            String fieldName = item.getFieldName();  
            // 取得文件名  
            String fileName = item.getName();  
            // 取得文件类型  
            String contentType = item.getContentType();  
              
            final Lock lock = new ReentrantLock();  
            String newName = null;  
            lock.lock();  
            try {  
                //加锁为防止同一时间文件名冲突   
                newName = System.currentTimeMillis()  
                        + fileName.substring(fileName.lastIndexOf("."),  
                                fileName.length());  
            } catch (Exception e) {  
                e.printStackTrace(System.err);  
            } finally {  
                lock.unlock();  
            }  
            filePath = "./ke_upload/" + newName;  
            File file = new File(request.getSession()
   .getServletContext().getRealPath("/")
   + "//ke_upload");
   if (!file.exists()) {
  file.mkdirs();
  }
  String path = request  
                    .getSession().getServletContext().getRealPath("/")  
                    + "//ke_upload//" + newName;
            FileOutputStream fos = new FileOutputStream(path);  
            if (item.isInMemory()) {  
                fos.write(item.get());  
                fos.close();  
            } else {  
                InputStream in = item.getInputStream();  
                byte[] buffer = new byte[1024];  
                int len;  
                while ((len = in.read(buffer)) > 0) {  
                    fos.write(buffer, 0, len);  
                }  
                in.close();  
                fos.close();
               
            }
            new TransferFileFtp().copyFileToFtp(path);   
        }  
    }  
    out.println("<html><head><title>Insert Image</title><meta http-equiv='content-type' content='text/html; charset=gbk'/></head><body>");  
    out.println("<script type='text/javascript'>");  
    out.println("parent.parent.KE.plugin['image'].insert('" + id  
            + "','" + filePath + "','" + imgTitle + "','" + imgWidth  
            + "','" + imgHeight + "','" + imgBorder + "','" + align  
            + "');</script>");  
    out.println("</body></html>");  
%>

 

由服务器上传图片到ftp的代码如下:

 

package com.glot.csp.lottery.common.ftp;

import java.io.FileInputStream;
import java.io.IOException;
import sun.net.TelnetInputStream;
import sun.net.TelnetOutputStream;
import sun.net.ftp.FtpClient;

public class TransferFileFtp {
 static FtpClient ftpClient;

 private Configuration configura = Configuration.getInstance();

 /**
  * 连接FTP、复制文件
  *
  * @throws Exception
  */
 public boolean copyFileToFtp(String path) throws Exception {

  try {
   ftpConnect();

   if (!isExistDir(configura.getValue("ftpFilePath")))
    mkDir(configura.getValue("ftpFilePath"));

   String[] sFileName;

   System.out.println(ftpClient.pwd());

   sFileName = path.split(configura.getValue("splitString"));

   TelnetOutputStream ftpOut = ftpClient
     .put(sFileName[sFileName.length - 1]);

   FileInputStream fs = new FileInputStream(path);
   TelnetInputStream ftpIn = new TelnetInputStream(fs, true);
   byte[] buf = new byte[204800];
   int bufsize = 0;
   while ((bufsize = ftpIn.read(buf, 0, buf.length)) != -1) {
    ftpOut.write(buf, 0, bufsize);
   }

   ftpIn.close();
   ftpOut.close();

   System.out.println(ftpClient.getResponseString());

  } catch (IOException e) {
   e.printStackTrace();
   return false;
  }
  ftpClient.sendServer("QUIT/r/n");
  return true;
 }

 /**
  * 连接FTP
  *
  */
 private void ftpConnect() {
  try {
   ftpClient = new FtpClient(configura.getValue("ipAdress"), Integer
     .parseInt(configura.getValue("port")));
   ftpClient.login(configura.getValue("userName"), configura
     .getValue("passWord"));
   ftpClient.binary();//避免传递的图片失真
   System.out.println(ftpClient.welcomeMsg);
  } catch (IOException e) {
   e.printStackTrace();
  }
 }

 /**
  * 判断ftp上是否存在路径
  *
  * @return boolean
  */
 private boolean isExistDir(String path) {
  try {
   ftpClient.cd(path);
  } catch (IOException e) {
   return false;
  }
  return true;
 }

 /**
  * 在ftp上创建文件夹
  *
  * @param dir
  *            文件夹名字
  */
 private void mkDir(String dir) {

  ftpClient.sendServer("MKD " + dir + "/r/n");

 }
}

 

使用python中pypower进行电力潮流计算 阅读详情

相关推荐

来自工业界的知识库 RAG 服务(二),RagFlow 源码全流程深度解析

前面介绍过有道 QAnything 源码解析,通过深入了解工业界的知识库 RAG 服务,得到了不少调优 RAG 服务的新想法。因此本次趁热打铁,额外花费一点时间,深入研究了另一个火热的开源 RAG 服务RagFlow的完整实现流程,希望同样有所收获。首先依旧可以先从框架图入手,与常规的 RAG 架构进行一些比较可以看到右侧知识库被明显放大,同时最右侧详细介绍了文件解析的各种手段,比如OCR等,这些在常规的 RAG 中可能会作为一个不起眼的。

易迟的专栏 2万+

Java实现FTP的上传和下载!

java实现连接FTP服务器,实现文件的上传和下载!!!

m0_63216218的博客 4865

多旋翼飞行器设计与控制·Pixhawk4以及外部设备接线(笔记004)

笔记主要来源:Pixhawk 4 接线快速入门 目录 一、Pixhawk 4 的各个接口 二、接线图概览(重要传感器及外围设备) 三、飞控、GPS的安装和方向 四、电源 五、无线电遥控 六、数传电台(可选) 七、SD Card(可选) 八、电机以及其他外设 一、Pixhawk 4 的各个接口 FMU:Flight Management Unit 飞行管理组件 主 FMU 处理器:STM32F765 32 位 Arm® Cortex®-M7,216MHz,2MB...

猪猪的博客 1万+

Java使用ftp上传图片到服务器 图片损坏

目前项目开发中图片存放方式有很多。通过ftp上传到ftp服务器就是其中的一种。 这两天在使用ftp上传图片时遇到了一个问题:图片上传以后需要移动文件夹。 我实现的思路大概是这样的: 1.先根据原图片路径找到对应的文件,拿到文件流 InputStream inputStream = ftp.retrieveFileStream(new String(filePath.getBytes("U...

qq_35771266的博客 2858

SAP-MM-采购过账接口(与WMS集成)-代码

1、判断传入值非空检验; 2、判断过账日期是否允许在当前期间; 3、判断是否为集采订单业务,是否审批完成; 4、判断是否发布标准成本发布(此业务场景与价格控制3+S有关) 5、保存日志表; 6、判断业务公司订单审批状态; 7、创建STO交货单、集采公司订单过账、STO公司间创建交货单、交货单过账(两步法)、过账失败回滚(冲销交货、删除交货单、冲销集采入库)

qq_32198063的博客 420

【AUTOSAR-DCM】-3.1-将CDD导入CFG并查看$22服务配置变化(UDS诊断DID带一个Data)

案例背景:(共8页精讲) 在《【UDS诊断描述文件CDD】-3.2-编辑CDD给$22服务创建一个带一个Data的DID(dataIdentifier)数据标识符》中,适应使用CANdela Studio在CDD中创建一个带一个Data的DID(dataIdentifier)数据标识符,见图0-1。现在我们将该CDD文件导入到CFG(DaVinci Configurator),看看配置会发生哪些变化。 图0-1 目录 1 将诊断描述文件CDD导入CFG(DaVinci Configurator.

「汽车电子助手」的博客 1633

Java使用FTP上传文件被损坏的问题

上传文件损坏

一步一个脚印的专栏 1万+

在Qt中集成VTK和PCL:实现数据可视化的完整指南

在现代软件开发中,数据可视化至关重要。将VTK(Visualization Toolkit)和PCL(Point Cloud Library)集成到Qt环境里,能为开发者提供强大的可视化解决方案。本文将深入讲解如何在Qt中读取PCL文件,展示VTK模型和PCL数据,适合想要在Qt项目中实现数据可视化的开发者。

轩宇的博客 916

java上传图片到FTP服务器

【代码】java上传图片到FTP服务器。

m0_47944994的博客 612

C#实现低通和高通滤波算法

低通滤波器允许通过低于某个截止频率的信号成分,并且抑制高于该频率的成分。而高通滤波器则允许通过高于某个截止频率的信号成分,并抑制低于该频率的成分。巴特沃斯滤波器是一种对称的滤波器,具有平坦的幅度响应和最小的群延迟。低通和高通滤波是数字信号处理中常用的滤波技术,用于滤除或增强信号中的特定频率成分。在本篇文章中,我们将使用C#编程语言来实现低通和高通滤波算法。以上就是使用C#实现低通和高通滤波算法的示例代码。你可以根据自己的需求调整截止频率和采样率,将这些代码应用于你的项目中。是滤波器的截止频率,

XisVisual_Basic的博客 1274

【STK】手把手教你利用STK进行覆盖分析02-生成详细分析报告和图表

这篇文章主要针对上一篇文章中最后的案例1进行进一步的说明,详细介绍我们可以生成哪些结论性的成果。STK的Coverage模块的生成结果包括分析报告和图表两种样式,每种样式还分为动态和静态两种,也就是说,我们做完一个STK覆盖场景的仿真后,一般可以生成静态分析报告、动态分析报告、静态分析图表和动态分析图表这4种形式的分析成果,下面进行详细介绍。我们在选择了想要分析的区域或者点后,就可以利用CovDef生成分析报告了,覆盖定义的分析报告分为静态报告和动态报告两种,下面分析进行介绍: 首先我们先在左侧目标浏览器C

weixin_44184852的博客 3442

Java实现FTP上传文件

Java实现FTP上传文件

qq_41579129的博客 6020

PCL RANSAC拟合直线并插值

空间直线线性插值的原理与实现方法。

点云侠的博客 136

java ftp图片上传_java中使用FTP进行图片的上传

packagecom.taotao.common.utils;importjava.io.File;importjava.io.FileInputStream;importjava.io.FileNotFoundException;importjava.io.FileOutputStream;importjava.io.IOException;importjava.io.InputStream;i...

weixin_35627928的博客 246

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

java ftp图片上传_Java实现图片上传至服务器功能(FTP协议)

本文为大家分享了java实现图片上传至服务器功能的具体代码,供大家参考,具体内容如下本案例实现图片上传功能分为两个步骤,分别为(1)APP用base64加密将图片内容上传至服务器(http协议),在临时目录中先存储好图片;(2)将服务器临时存储的图片用FTP协议上传至另一台专门用做存储图片的服务器;/*** ftp 文件操作服务实现类**/@Servicepublic class FtpFileS...

weixin_42197110的博客 339

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

java ftp图片上传_前台多图片上传,Java后台处理后上传到ftp上并回显

本文是《页面ajax上传图片后,后台上传图片服务器后回显》发出后,很多网友说,不能多图片上传的。欢迎关注凯哥公众号:凯哥Java凯哥个人网站:www.kaigejava.com所以,本篇介绍多图片上传。解决思路:先获取MultipartFile multipartFile 对象。在进行循环遍历得到单个对象。首先,我们来回顾下,单图片上传的后台代码:请求参数中:需要@RequestParam("fi...

weixin_42191359的博客 447

IDEA的使用指南

IDEA基于java的使用手册,可以最快速的上手,在使用中不断的丰富自己的使用技巧.

java ftp传图片_Java 图片上传方式一 : ftp 图片服务器

一 : Linux ftp 图片服务器1、 Linux 安装 ftplinux服务器配置安装ftpyum install vsftpd启动服务service vsftpd start开机启动chkconfig --level 35 vsftpd on设置权限vi /etc/vsftpd/vsftpd.conf将配置文件中”anonymous_enable=YES“改为 “anonymous_ena...

weixin_39543835的博客 392

java ftp上传图片_前台多图片上传,Java后台处理后上传到ftp上并回显-java文件传输...

本文是《页面ajax上传图片后,后台上传图片服务器后回显》发出后,很多网友说,不能多图片上传的。所以,本篇介绍多图片上传。解决思路:先获取MultipartFile multipartFile 对象。在进行循环遍历得到单个对象。首先,我们来回顾下,单图片上传的后台代码:请求参数中:需要@RequestParam("file") MultipartFile multipartFile且是必填的。通过...

weixin_39958631的博客 180

java上传图片到ftp服务器上_Java实现图片上传至服务器功能(FTP协议)

本文为大家分享了java实现图片上传至服务器功能的具体代码,供大家参考,具体内容如下本案例实现图片上传功能分为两个步骤,分别为(1)APP用base64加密将图片内容上传至服务器(http协议),在临时目录中先存储好图片;(2)将服务器临时存储的图片用FTP协议上传至另一台专门用做存储图片的服务器;/*** ftp 文件操作服务实现类**/@Servicepublic class FtpFileS...

weixin_42501688的博客 452

用ftp服务上传图片 java_使用nginx和vsftp搭建图片服务器并使用Java上传图片到该图片服务器...

安装vsftp1、首先,安装vsftpdyum -y install vsftpd2、验证是否安装成功rpm -qa vsftpd3、查看vsftp相关配置文件ll /etc/vsftpd/vsftpd.conf文件是主要的配置文件,一些关键的配置都在其中ftpusers文件是禁止使用vsftpd的用户列表文件,记录不允许访问FTP服务器的用户名单user_list这个文件禁止或允许使用vsftp...

weixin_39759441的博客 204

java 上传的图片大小为0_Java上传图片到Ftp,包含上传后文件大小为0的问题和Properties配置文件的读取...

准备工作:需要使用coomos-net jar包。下载地址 一、 上传图片到FTP,文件大小为0的问题,解决:将ftp模式修改为Passive模式就可以了。//将ftp模式修改为Passive模式ftpClient.enterLocalPassiveMode();1.使用.properties配置文件的形式定义相关常量。 2.在工具类中导入配置文件 private staticPropertie...

weixin_35719775的博客 437

java中使用FTP进行图片的上传

使用ftp需要引入两个jar包(commons-net、commons-fileupload) 1、添加ftp服务器配置文件 #FTP FTP_ADDRESS=192.168.25.133  //目标服务器ip FTP_PORT=21           //ftp默认端口21 FTP_USERNAME=ftpuser      //用户名 FTP_PASSWORD=ftpuser...

weixin_30449239的博客 564

java ftp 同步_java js 文件图片通过FTP进行上传和同步

下面是js 和后台java完整代码:function uploadImage(){uuid = new UUID().createUUID();var fileName = $("#videoImage").val();var array1=fileName.split(".");if(array1[array1.length-1]=="jpg"||array1[array1.length-1]=...

weixin_35368877的博客 140

Java上传图片到FTP服务器

第一步:web页面 [html] view plain copy span style="white-space:pre">  span>form id="add" class="form-horizontal" enctype="multipart/form-data" action="upload.shtml" method="post"> 

DreamWeaver_Zhou 1408

java 同步上传图片_java js 文件图片通过FTP进行上传和同步

下面是js和后台Java完整代码:function uploadImage(){uuid = new UUID().createUUID();var fileName = $("#videoImage").val();var array1=fileName.split(".");if(array1[array1.length-1]=="jpg"||array1[array1.length-1]=...

weixin_35900054的博客 151
下一篇: java调用quartz问题总结
usercore
博客等级 码龄20年 9粉丝 9原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值