Here is a better question. I've modified the code also. If I am just connecting to an URL through a servlet. What could be corrupting the file if it opens on its own without httpconnect . What is that adding to this situation? It connects, opens the player and I get a file corruption error. but If I go straight to the URL
http://www.foo.com/MovementDemo.wmv ... it opens up just fine. I thought If I set the response object to the mime type it would open it just like it would if the url was in the address bar?
[code]
package TESTLINK;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;
public class WindowsMediaServer extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)throws ServletException, IOException {
response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);
response.setContentType("video/x-ms-wmv");
try{
URL theUrl = new URL("http://www.foo.com/MovementDemo.wmv");
URLConnection connection = theUrl.openConnection();
HttpURLConnection http = (HttpURLConnection)connection;
http.connect();
}catch(ConnectException ce){
}
}
}
anything please, thanks