Check whether HTTP server supports "Range" request header

Hi,
I'm trying to develop a multi-threaded download manager which downloads several parts of the file concurrently using the "Range" HTTP request header field. However, I find that it is possible for servers to ignore that field.
As per HTTP specs, checking the "Accept-Ranges" field doesn't seem to be very reliable. How do I check whether the HTTP server of the URL supports range requests. This is essential for both multi-threaded downloads and pausing and resuming downloads.

I suspect that the only reliable way would be via testing. Second most reliable would be via documentation for the site (but a poor second to the first.)
Then once you have the information put it in a configuration file so the app can use it.

Similar Messages

  • Error starting HTTP-Server: Cannot assign requested address: JVM_Bind

    Hi.
    Anyone know how to configure the Oracle HTTP server within Jdeveloper9i to work?
    When I try run a JSP page, I get the following error:
    C:\Oracle9iDS\jdk\bin\javaw.exe -ojvm -classpath C:\Oracle9iDS\j2ee\home\oc4j.jar com.evermind.server.OC4JServer -config C:\Oracle9iDS\jdev\system\oc4j-config\server.xml
    [Starting OC4J using the following ports: HTTP=8888, RMI=23891, JMS=9227.]
    [waiting for the server to complete its initialization...]
    Error starting HTTP-Server: Cannot assign requested address: JVM_Bind
    Oracle9iAS (9.0.2.0.0) Containers for J2EE initialized
    Please contact me at [email protected]
    cheers paul

    A JVM_Bind error means that the port is already in use. This is an unusual error message to get because JDev scans the ports ahead of time to make sure they are free before launching the server.
    Check if you have any processes running that might be holding port 8888. There might be a previous instance of the OC4J server running that hasn't released port 8888 yet. On Windows, at a command prompt, you can use "netstat -a" to see local ports that are in use.

  • How to check whether the browser supports cookie using servlet

    Hi
    I have a servlet that uses session.I want to check whether the browser supports cookie.
    Please help me how can i detect this using servlet.
    could you please include a sample code
    thanks
    sabu

    You can check whether any cookies were sent in the request to your servlet:
    Cookie cookies[] = request.getCookies();
    if cookies is not null (cookies != null) then the browser sending you the request suppoerts cookies.
    If it is null then you would need to do a little extra work. Basically add a cookie to the response going back to the browser. Then send a redirect back to this same servlet. You then would have to add code to check to see whether the cookie was sent back.
    // Servlet named myServlet
    String test = request.getParameter("TEST");
    Cookie cookies[] = request.getCookies();
    if (test == null || !test.equals("TRUE")
    if (cookies == null)
    response.addCookie("testCookies","testCookies");
    response.sendRedirect("myServlet?TEST=TRUE");
    else
    // cookies were sent in the initial request, so
    // browser supports cookies
    else
    // This is the redirect. Check the for the presence of
    // our testCookie
    Hope this helps.

  • Is there a way to check whether an Excel file has a header or not?

    Hi!
    I'm currently using POI Utility to read and write Excel files.
    You normally use the HasHeaderRow = true / false to specify whether the file has a header or not.
    Now, let's say I have a program that needs to read Excel files from a directory, some have headers, some don't.
    Is there a way to know dynamically whether a header has been defined or not?
    Then, for those having headers, the flag will be set as true, while for those which don't have any header, the flag will be set as false.
    E.g.
    <!--- Create an instance of the POIUtility.cfc. --->
        <cfset objPOI = CreateObject(
            "component",
            "POIUtility"
            ).Init()
            />
    <!--- Set directory --->
    <cfset currentDirectory = GetDirectoryFromPath(GetTemplatePath()) & "newDir">
    <!--- Check whether the directory exists. --->
    <cfif DirectoryExists(variables.currentDirectory)>
         <!--- Read files from the specified directory --->
         <cfdirectory action="list" directory="#variables.currentDirectory#" type="file" filter="*.xls" name="qDirectory">
         <!--- Check if the directory has any Excel file --->
         <cfif variables.qDirectory.recordcount gt 0>
              <!--- Loop query --->
         <cfloop query="variables.qDirectory">
                   <!--- Check if header is present in each of the file --->
                        IF headerExists THEN
                             headerFlag = true
                        ELSE
                             headerFlag = false
                        END IF
                   <!--- Read Excel File --->
                <cfset objSheet = objPOI.ReadExcel(FilePath = #variables.qDirectory.name#, HasHeaderRow = #variables.headerFlag#, SheetIndex = 0) />
              </cfloop>
         </cfif>
    </cfif>
    Any help would be most welcome.
    Thanks and regards,
    Yogesh Mahadnac  

    Hi cfSearching,
    Many thanks for your reply! I really do appreciate!
    However, I've still got 1 more question for you.
    At the moment, I'm using POI and sometimes cfx_Excel2Query to read Excel files.
    In both cases, you have to specify whether the first row is a header.
    How would you read the Excel file to check whether the 1st row is the header?
    I've tried using cffile, but I get all sorts of "garbage"
            <cffile action="read" file="#variables.filename#" variable="xlsResult">
            <cfloop index="i" list="#variables.xlsResult#" delimiters="#chr(13)#&#chr(10)#">
                <cfif variables.i eq 1>
                    <cfoutput>
                        Test 1st Row: #trim(replacenocase(listgetat(variables.i,1,","),'"',"","All"))#
                    </cfoutput>
                </cfif>
            </cfloop>
    I get the following output:
    ÐÏ à¡± á����.... etc etc
    I'd be very much grateful if you could please advise on the latter at your earliest convenience.
    Thanks and best regards,
    Yogesh Mahadnac

  • How to check whether weblogic server is in DEBUG mode or not

    Hi
    I want to check in my OSB proxy whether weblogic server is in Debug mode or not?
    IF abv thing is not possible ,
    I have check whether server is in development mode or production mode from my OSB proxy service?
    I m not able to find any doc on this??Please let me know how it can be done?
    Thanks

    There isnt any other way except for doing a Java Callout. In the callout method you can access the Domain/Server MBean for the information that you seek. Based on the callout result you can go ahead with the logic in your PS..
    Here is a sample Java Code to get the Server Log Level and ascertain whether the server is in Production Mode or not.
    package com.dell.mbean;
    import java.io.IOException;
    import java.net.MalformedURLException;
    import java.util.Hashtable;
    import javax.management.MBeanServerConnection;
    import javax.management.MalformedObjectNameException;
    import javax.management.ObjectName;
    import javax.management.remote.JMXConnector;
    import javax.management.remote.JMXConnectorFactory;
    import javax.management.remote.JMXServerErrorException;
    import javax.management.remote.JMXServiceURL;
    import javax.naming.Context;
    public class MyConnection {
         private static MBeanServerConnection connection;
         private static JMXConnector connector;
         private static final ObjectName service;
         static {
              try {
              service = new ObjectName("com.bea:Name=DomainRuntimeService,Type=weblogic.management.mbeanservers.domainruntime.DomainRuntimeServiceMBean");
              catch (MalformedObjectNameException e) {
              throw new AssertionError(e.getMessage());
         * Initialize connection to the Domain Runtime MBean Server.
         @SuppressWarnings("unchecked")
         public static void initConnection(String hostname, String portString,
         String username, String password) throws IOException,
         MalformedURLException {
         String protocol = "t3";
         Integer portInteger = Integer.valueOf(portString);
         int port = portInteger.intValue();
         String jndiroot = "/jndi/";
         String mserver = "weblogic.management.mbeanservers.domainruntime";
         JMXServiceURL serviceURL = new JMXServiceURL(protocol, hostname, port,
         jndiroot + mserver);
         Hashtable h = new Hashtable();
         h.put(Context.SECURITY_PRINCIPAL, username);
         h.put(Context.SECURITY_CREDENTIALS, password);
         h.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,"weblogic.management.remote");
         h.put("jmx.remote.x.request.waiting.timeout", new Long(10000));
         try {
         connector = JMXConnectorFactory.connect(serviceURL, h);
         connection = connector.getMBeanServerConnection();
         } catch(JMXServerErrorException jmxSE)
              jmxSE.printStackTrace();
         catch(Exception ex)
              ex.printStackTrace();
         public static String getLogSeverity(String hostName, String portName, String userName, String password) throws Exception {
              initConnection(hostName, portName, userName,password);
              connector.close();
              ObjectName domainConfig = (ObjectName) connection.getAttribute(service,
              "DomainConfiguration");
              ObjectName logMbean =(ObjectName) connection.getAttribute(domainConfig, "Log");
              String logFileFilter = (String) connection.getAttribute(logMbean, "LogFileSeverity");
              System.out.println("Log File Filter= "+ logFileFilter.toString());
              return logFileFilter;
         public static boolean isProductionModeEnabled(String hostName, String portName, String userName, String password) throws Exception {
              initConnection(hostName, portName, userName,password);
              connector.close();
              ObjectName domainConfig = (ObjectName) connection.getAttribute(service,
              "DomainConfiguration");
              boolean prodEnabled= (Boolean) connection.getAttribute(domainConfig, "ProductionModeEnabled");
              System.out.println("Is Production Mode Enabled=" +prodEnabled);
              return prodEnabled;
    Make sure you have wlclient.jar and wljmxclient.jar as your dependent libraries.

  • Oracle HTTP Server Support Dates

    What are the lifetime support dates for Oracle HTTP Server 10gR3 ?
    Thanks, Richard.

    Yes, Oracle HTTP Server will communicate to the J2EE container (OC4J) via mod_oc4J. It is completly supported starting 9.0.2, out of box.
    Regards
    Pavna Jain
    Oracle9iAS Product Management Team

  • Checking whether a server is running

    Hi all,
    I have a form that should submit its xdp to a server side component. However if the server is down the user is left with a Error 404.
    I am submitting through the following code:
    myDoc.submitForm({
        cURL: submitUrl ,
        cSubmitAs: "XDP",
        aPackets: ["*", "pdf"],
        cCharset: "utf-8",
    I am wondering if there is any way you can do a test before I do the actual submit to see if the server is up and if it is then do the submit?
    Anyone with an idea how to do this?
    Thanks in advance
    Sincerely
    Kim Christensen
    Dafolo A/S

    No. But, I have written a script which will read the application custom xml to retrieve the weblogic server IP address, port number, username and password and start & stop the weblogic servers

  • How to check whether the Application Server directory exits or not

    Hi,
    I have a selection screen in which I give the Application server file name(UNIX file) as input. Here, I would like to check whether the Server directory exists or not.
    Let us say, the path I gave in the selection screen is /usr/sap/tmp/testfile.txt . Here, the file name is testfile.txt and the server directory is /usr/sap/tmp . I would like to check whether this directory /usr/sap/tmp exists in the server or not. I am not bothered about the file name as I am going to write data into the file. I am mainly concerned about whether the directory exists in the server or not. and one more thing... this is the Application Server path not the Local path.
    Can anyone help me on the same how to check whether the server directory exists or not.
    Thanks in advance.
    Best Regards,
    Pradeep.

    Also you can use the FM EPS_GET_DIRECTORY_LISTING for this purpose.
      Store the directory name
        l_dpath = p_file+0(l_no).
      Validate the directory of the application server
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = l_dpath
          TABLES
            dir_list               = l_i_dlist
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
      If any problem occurs with the directory then display proper
      error message
        IF sy-subrc <> 0.
        Display error message
          MESSAGE e018 WITH 'Problem with directory entered'(008).
        ENDIF. " sy-subrc <> 0
    Regards,
    Joy.

  • How to findout whether the mail server supports STARTTLS or not?

    Hi,
    In my application I want to use explict SSL over SMTP, IMAP and POP3 by using the property "mail.<protocol>.starttls.enable"
    . I did see the documentation for mail.<protocol>.starttls.enable property as
    "If true, enables the use of the <code>STARTTLS</code> command (if
    supported by the server) to switch the connection to a TLS-protected
    connection before issuing any login commands".
    How do I findout whether the server supports STARTTLS or not?
    What will be the outcome if I use the property "mail.<protocol>.starttls.enable" though the server doe's not support STARTTLS? plain text connection will be there or will it throw any exception?
    Thanks in advance!
    PrasadKT

    The "mail.<protocol>.starttls.enable" property will use STARTTLS if the server
    supports it, and won't if it doesn't. Not using it might cause later commands to fail.
    Newer versions of JavaMail also have a "mail.<protocol>.starttls.required"
    property that will cause the connection to fail if the server doesn't support
    STARTTLS.

  • TS1424 error when submitting a podcast rss: byte-range requests

    Hi when I submit rss feeds now I'm getting an error message that we need to enable byte-range requests.
    I saw this article:
    http://theaudacitytopodcast.com/itunes-changes-podcast-specs-and-features/
    saying that " iTunes now requires all hosting servers to enable Byte Range Requests"
    my podcast mp3 is hosted in CDN that, as I've checked, supports range requests.
    but my rss feed contains urls that first return a redirect, to the real url (where range requests are supported)
    could this be a problem? are redirects on episode urls supported (they were until now)? should I modify the redirect response somehow to indicate that range requests are supported on the target server (I thought that shouldn't be necessary)?
    take this as a feed example: http://www.blogtalkradio.com/djsqwyd.rss
    Thanks in advance,

    URL:
    https://www.seven-thoughts.com/rss/rss.xml

  • Companion CDs for 64-bit Oracle HTTP Server for AIX5L(64 bit) required.

    I need Companion CDs for 64 bit Oracle HTTP Server for AIX5L(64 bit).
    I tried to install using
    as_ibm_aix_companion_101300_disk1.cpio & as_ibm_aix_companion_101300_disk2.cpio
    but when i checked the files present in <Oracle_Home>/ohs/lib , they are of 32-bit.
    Also i tried with Oracle 10.1.2.0.2 but still the server is installed as 32-bit.
    Is 64-bit Oracle HTTP Server supported on AIX5L(64 bit) ?
    If yes, then from where can i download the CDs?
    Any suggestions will be appreciated.

    Greetings,
    Try this link:
    http://www.oracle.com/technology/software/products/database/oracle10g/htdocs/10201aixsoft.html
    Regards,
    Bill Chadbourne

  • How to check whether socket or servlet mode?

    HI
    What are the various ways to check whether forms server is in socket mode or servlet mode.
    Thanks
    JIL

    You can check context file also
    you can confirm form server is set at servlet mode by
    -bash-3.00$ grep s_frmConnectMode $CONTEXT_FILE
    <forms_connect oa_var="s_frmConnectMode">servlet</forms_connect>
    -bash-3.00$
    socket mode by,
    -bash-2.05b$ grep socket $CONTEXT_FILE
    <forms_connect oa_var="s_frmConnectMode">socket</forms_connect>
    -bash-2.05b$ grep
    Suresh
    http://applicationsdba.blogspot.com

  • Maintaining cookies at the HTTP server level?

    Hi,
    My Apache HTTP server authenticates the request by hitting another server before forwarding the request to the J2EE App Servers. Is there any way to avoid this authentication hit on every request at the HTTP Server using cookies for the same session since the user is already authenticated.
    Thanks
    AA

    ash261080 wrote:
    Hi,
    My Apache HTTP server authenticates the request by hitting another server before forwarding the request to the J2EE App Servers.Is that a custom logic you have built? I havent read about such behaviour offered by default.
    ram.

  • Enterprsise search error  - HTTP server error: 503 (Errorcode 7266)

    HI
    i am geting following error when serching docs in portal using TREX..
    Search Failure
    Error during search occurred - com.sapportals.wcm.WcmException: HTTP server error: 503 (Errorcode 7266)
    An unexpected severe error occurred during the search call. If the situation persists, inform your system administrator.
    Indexing document failed. Communication error. HTTP server error: 503 (Errorcode 7266)
    Regards
    Buddhike

    Hi,
      Can you please check the information and links given in the below threads. These will give more information of checking the HTTP Server etc..
    https://forums.sdn.sap.com/thread.jspa?threadID=84269
    https://forums.sdn.sap.com/thread.jspa?threadID=23496
    https://forums.sdn.sap.com/thread.jspa?threadID=71527
    Raghavendra

  • Regarding HTTP server

    I would like to know whether HTTP server comes along with the Oracle 10g Database or we need to install it seperately.

    Hello Ashir,
    In case you still need an answer to your question:
    HTTP server is on Oracle Database 10g Companion CD, you can install it from there.
    Thanks,
    DanielD

Maybe you are looking for