html to ftp redirection not working

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Manu

    html to ftp redirection not working

    Hi there,
    I am using a perl script to generate this html page which just
    redirects users to my ftp server. The problem is I get a "page cannot
    be displayed" in IE 6.0 (haven't tried other browsers) when the
    redirection happens. But the redirection happens to the correct ftp
    location and on pressing "Refresh" the FTP login dialog bar appears
    and everything is fine.

    Here is the HTML in question.

    <HTML>
    <HEAD>
    <META http-equiv='REFRESH' content = '3; URL =
    ftp://192.168.0.11'>
    <TITLE>FTP Data</TITLE>
    </HEAD>
    <BODY>
    <p>You are being redirected to ftp://192.168.0.11 in 3 seconds</p>
    </BODY>
    </HTML>

    and the perl file that generates the html is

    #!/usr/bin/perl
    print "Content-type: text/html\n\n";
    print "<HTML><HEA D>";
    print "<META http-equiv='REFRESH' content = '3; URL =
    ftp://$ENV{'HTTP_HOST '}'>";
    print "<TITLE>FTP Data</TITLE>";
    print "</HEAD><BODY>";
    print "<p>";
    print "You are being redirected to ftp://$ENV{'HTTP_HOST '} in 3
    seconds";
    print "</p>";
    print "</BODY></HTML>"

    Can anyone tell me how to deal with this glitch? Thanks in advance.
    -Manu
  • Shawn K. Quinn

    #2
    Re: html to ftp redirection not working

    Manu wrote:
    [color=blue]
    > Hi there,
    > I am using a perl script to generate this html page which just
    > redirects users to my ftp server. The problem is I get a "page cannot
    > be displayed" in IE 6.0 (haven't tried other browsers) when the
    > redirection happens. But the redirection happens to the correct ftp
    > location and on pressing "Refresh" the FTP login dialog bar appears
    > and everything is fine.
    >
    > Here is the HTML in question.
    >
    > <HTML>
    > <HEAD>
    > <META http-equiv='REFRESH' content = '3; URL =
    > ftp://192.168.0.11'>[/color]
    [...][color=blue]
    > Can anyone tell me how to deal with this glitch? Thanks in advance.[/color]

    Yes, rewrite the Perl script that instead issues a real HTTP redirect
    instead of quasi-standard <meta http-equiv> junk. IE, as well as real Web
    browsers, should handle this much better.

    --
    Shawn K. Quinn

    Comment

    • Brian

      #3
      Re: html to ftp redirection not working

      Manu wrote:
      [color=blue]
      > this html page which just redirects users to my ftp server.[/color]

      Why don't you just provide a link to the ftp server? Are users incapable
      of following a link?
      [color=blue]
      > The problem is I get a "page cannot be displayed" in IE 6.0 (haven't
      > tried other browsers) when the redirection happens. But the
      > redirection happens to the correct ftp location and on pressing
      > "Refresh" the FTP login dialog bar appears and everything is fine.[/color]

      IE/Win issues one set of accept headers when it tries a new url. But it
      issues different accept headers when reloading (or "refreshing ") the
      url. It's very strange behavior. You can, apparently, edit what accept
      headers IE sends by editing the Windows registry. I've never been brave
      enough to try that, perhaps because I've been frightened away by warning
      messages.
      [color=blue]
      > <META http-equiv='REFRESH' content = '3; URL = ftp://192.168.0.11'>[/color]

      Non-standard.

      It seems to me that, if the page is merely an intermediary step to the
      content, then a server redirect with proper response code, is
      appropriate. But if you don't want to send www ua's to an ftp server
      without the user's explicit knowledge -- that would be best in my view
      -- then a simple link would be best.

      --
      Brian (remove "invalid" from my address to email me)

      Comment

      • Brian

        #4
        Re: html to ftp redirection not working

        Shawn K. Quinn wrote:
        [color=blue]
        > Manu wrote:
        >[color=green]
        >> I get a "page cannot be displayed" in IE 6.0 (haven't tried other
        >> browsers) when the redirection happens. But the redirection happens
        >> to the correct ftp location and on pressing "Refresh" the FTP login
        >> dialog bar appears and everything is fine.[/color][/color]

        The difference in the 2 responses is key, I think.
        [color=blue][color=green]
        >> Here is the HTML in question.
        >>
        >> <META http-equiv='REFRESH' content = '3; URL = ftp://192.168.0.11'>
        >>[/color]
        >
        > rewrite the Perl script that instead issues a real HTTP redirect
        > instead of quasi-standard <meta http-equiv> junk.[/color]

        Certainly good advice.
        [color=blue]
        > IE, as well as real Web browsers, should handle this much better.[/color]

        If by real web browsers you mean those with appropriate (IMHO) accept
        headers, then I agree, they will handle it better. (Though a text link
        may still be preferable.)

        IE/Win is another matter. I'm not sure what its accept headers will mean
        for the ftp protocol. See also my first note in this thread for a brief
        explanation.

        --
        Brian (remove "invalid" from my address to email me)

        Comment

        • Brian

          #5
          Re: html to ftp redirection not working

          Manu wrote:
          [color=blue]
          > html page which just redirects users to my ftp server. The problem is
          > I get a "page cannot be displayed" in IE 6.0 (haven't tried other
          > browsers)[/color]


          You probably should try other browsers. ;-)
          [color=blue]
          > ftp://192.168.0.11[/color]

          I just tried that address in Mozilla 1.6/Win; operation timed out. Tried
          it in MSIE 5.5/Win; the "browser" changed into an os thingy of some
          sort; error, "Windows was unable to browse this folder." Looks like the
          problem is server related.
          [color=blue]
          > when the redirection happens. But the redirection happens
          > to the correct ftp location and on pressing "Refresh" the FTP login
          > dialog bar appears and everything is fine.[/color]

          Given the two different results in IE/Win, I'd have to think it has to
          do with the change in accept headers. But then, on reflection, I don't
          know how MSIE/Win reacts to an ftp server, and I don't have the means to
          test it. Apologies if my earlier post turns out to be a red herring.

          --
          Brian (remove "invalid" from my address to email me)

          Comment

          • Daniel R. Tobias

            #6
            Re: html to ftp redirection not working

            Brian <usenet3@juliet remblay.com.inv alid> wrote in message news:<108b0kui3 f4e0e5@corp.sup ernews.com>...[color=blue]
            > Given the two different results in IE/Win, I'd have to think it has to
            > do with the change in accept headers. But then, on reflection, I don't
            > know how MSIE/Win reacts to an ftp server, and I don't have the means to
            > test it. Apologies if my earlier post turns out to be a red herring.[/color]

            Does the FTP protocol even use "accept headers"?

            --
            Dan

            Comment

            • Brian

              #7
              Re: html to ftp redirection not working

              Daniel R. Tobias wrote:
              [color=blue]
              > Brian wrote...
              >[color=green]
              >> Given the two different results in IE/Win, I'd have to think it has
              >> to do with the change in accept headers. But then, on reflection, I
              >> don't know how MSIE/Win reacts to an ftp server, and I don't have
              >> the means to test it. Apologies if my earlier post turns out to be
              >> a red herring.[/color]
              >
              > Does the FTP protocol even use "accept headers"?[/color]

              I don't know, but when the question is posed so bluntly, it seems like
              the answer is no. Why would it? How would it? It makes no sense. The
              more I think about it, the more I think my initial response was barely
              half-baked. My apologies. The change on reload sent me running in the
              wrong direction. (I was unable to connect using Mozilla, as well as IE,
              so it perhaps the op was seeing nothing more than an unresponsive server.)

              --
              Brian (remove "invalid" from my address to email me)

              Comment

              • Manu

                #8
                Re: html to ftp redirection not working

                Brian <usenet3@juliet remblay.com.inv alid> wrote
                [color=blue]
                > Why don't you just provide a link to the ftp server? Are users incapable
                > of following a link?[/color]

                In the end thats what I did. The problem really happened when the web
                + FTP server was configured to DHCP (from a static IP) in our
                intranet. Originally I had a link from index.htm to
                ftp://staticIPofTheServer as the FTP link. When the server moved to
                DHCP I thought I could just change the link to point to ftp.pl which
                then redirects it to the FTP server. Also I didn't want users follow 2
                links instead of just 1 to get to the FTP server. Now I have my
                index.htm with an IFRAME (links.pl) which generates the correct FTP
                link and solved the problem.

                [color=blue]
                > You probably should try other browsers. ;-)[/color]

                I use linux/mozilla and the command prompt to FTP, but 90% of my
                office uses IE6.0 and don't like change.

                [color=blue]
                > I just tried that address in Mozilla 1.6/Win; operation timed out. Tried
                > it in MSIE 5.5/Win; the "browser" changed into an os thingy of some
                > sort; error, "Windows was unable to browse this folder." Looks like the
                > problem is server related.[/color]

                Thats because you are not inside my intranet. Thats a class C IP
                address. Its not a globally unique IP and is only used inside
                intranets.


                Thank you all for your advice and helping me work around this problem.
                I would still be interested in knowing what the real problem was.

                Comment

                • Brian

                  #9
                  Re: html to ftp redirection not working

                  Manu wrote:
                  [color=blue]
                  > Brian wrote
                  >[color=green]
                  >> I just tried that address in Mozilla 1.6/Win; operation timed out.[/color]
                  >
                  > Thats because you are not inside my intranet.[/color]

                  You might have mentioned that in your op, saved me (and probably others)
                  some time.
                  [color=blue]
                  > Thank you all for your advice and helping me work around this problem.
                  > I would still be interested in knowing what the real problem was.[/color]

                  Without a url accessible to us, I have no way of investigating any further.

                  --
                  Brian (remove "invalid" from my address to email me)

                  Comment

                  Working...