java怎么生成文件到指定ip的电脑上
1、首先在服务器端新建文件夹temp如下图所示

3、选择共享如下图所示。

5、在上图所示弹出窗口,点击权限按钮,弹出第三个窗口,在“组或用户名”添加everyone,设置everyone的权限为完全控制,确定退出。

7、以下是本地文件上传到局域网内temp文件夹的代码publicvoid upTemp(HttpServletR髫潋啜缅equest request,HttpServletResponse response){ Map map=new HashMap(); File remoteFile = null; String remotePath = ""; String remoteName = ""; MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; MultipartFile file = multipartRequest.getFile("tempFile"); StringlocalName = file.getOriginalFilename(); if(localName.trim() !=""){ remoteName = new Date().getTime() + localName; remotePath = "\\\\192.168.0.225\\temp\\" + remoteName; remoteFile = new File(remotePath); file.transferTo(remoteFile); response.getWriter().write("{remotefileName':'"+remoteName+"'}");}}