Upload files to the server through the HTTP POST method

zhaozj2021-02-17  56

This is actually imitating the POST behavior of the browser. The problem is proposed by the project in the internal network of an enterprise. The company network and Internet are connected through a HP-UNIX server, and the project needs to be transmitted from the Internet. Some text files to a Web server of the internal network, we can only go in through the HP-UNIX host, when the web server of the Internet is the DOTNET framework, which is easy to write the web interface uploaded by the file. It's trouble, I can't access the file directly to the page with the browser, so I have to write a program that mimic the browser upload file with Java. Environment: Introduction Web Server: Windows2000 DotNet Framework1.0 External Network Host: HP-UNIX (What version number forgot), JDK1.4 First, we solve easy problems, we know the file upload function package of ASP.NET It is very perfect. Very easy, we write this uploaded page (named TestfileManager.aspx):

<% @ Page language = "c #" CODEPAGE = "936"%> <% @ import namespace = "system"%> <% @ Import namespace = "system.io"%>