Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.File;
- import java.io.IOException;
- import javax.servlet.ServletException;
- import javax.servlet.annotation.MultipartConfig;
- import javax.servlet.http.HttpServlet;
- import javax.servlet.http.HttpServletRequest;
- import javax.servlet.http.HttpServletResponse;
- import pt.ipb.dthor.torrent.DThorTorrent;
- import pt.ipb.dthor.torrent.DThorTorrentParser;
- @MultipartConfig
- public class Upload extends HttpServlet {
- @Override
- protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
- File tempDir = new File(System.getProperty("java.io.tmpdir"));
- File writeDir = new File(tempDir.toString(), "xxx");
- request.getPart("file").write(writeDir.toString() + "/xxx.dat");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement