url upload script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    url upload script

    ok here is simple url upload script:


    PHP Code:

    <?php
    $PHP_SELF 
    $_SERVER['PHP_SELF'];

    if (
    $_GET[xfer]) {
    if (
    $_POST[from] == "") {
    print 
    "You forgot to enter a url.";
    } else {
    copy("$_POST[from]""$_POST[to]");
    $size round((filesize($_POST[to])/1000000), 3);
    print 
    "transfer complete.<br>
    <a><a href=\"
    $_POST[from]\">$_POST[from]</a><br>
    <a><a href=\"
    $_POST[to]\">$_POST[to]</a> : $size MB";
    }
    } else {
    print 
    "<form action=\"$PHP_SELF?xfer=true\" method=post>
    from(http://): <input name='from' value=''><br>
    to(filename): <input name='to'><br>
    <input type=submit value=\"transload\">"
    ;
    }
    ?>

    hope this will be usefull to all of you and ya dont forget to click on thanks button
    Last edited by neostar; 14.06.13, 18:42. Reason: fixed php tags ie [PHP]X[/PHP]

    #2
    Originally posted by neostar View Post
    ok here is simple url upload script:


    PHP Code:

    <?php
    $PHP_SELF 
    $_SERVER['PHP_SELF'];

    if (
    $_GET[xfer]) {
    if (
    $_POST[from] == "") {
    print 
    "You forgot to enter a url.";
    } else {
    copy("$_POST[from]""$_POST[to]");
    $size round((filesize($_POST[to])/1000000), 3);
    print 
    "transfer complete.<br>
    <a><a href=\"
    $_POST[from]\">$_POST[from]</a><br>
    <a><a href=\"
    $_POST[to]\">$_POST[to]</a> : $size MB";
    }
    } else {
    print 
    "<form action=\"$PHP_SELF?xfer=true\" method=post>
    from(http://): <input name='from' value=''><br>
    to(filename): <input name='to'><br>
    <input type=submit value=\"transload\">"
    ;
    }
    ?>

    hope this will be usefull to all of you and ya dont forget to click on thanks button

    Thanks
    - Rajendra Pondel
    Thanks for the share buddy but if that was open to anyone to upload, imagine the stuff they could do to it..

    Comment


      #3
      Lol, mate its just an idea how to fetch larger files to ur server, its upto u for authentication code modification.

      Comment


        #4
        hey neostar , your neat script lives on
        (hum no spoiler function?? well anyway, so then without..)
        PHP Code:
        <?php
        /* http://coding-talk.com/forum/main-forums/scripts-forum/6102-url-upload-script */
        $PHP_SELF $_SERVER['PHP_SELF'];
        print 
        "<!doctype html>
        <html>
        <head>
        <meta charset="
        UTF-8">
        <title>Simple URL Transload Script (by Neostart & Lee Binder)</title>
        <style type="
        text/css">
        body {
          margin-top: 20px;
          margin-left: 1.5%;
          margin-right: 1.5%;
        }
        body,form,input,td,th {
          font-family: "
        Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", "DejaVu Sans", Verdana, "sans-serif";
          font-size: 18px;
        }
        input {
          padding: 12px 20px;
          margin: 8px 0;
          box-sizing: border-box;
          border-radius: 4px;
        }
        input[type=text] {
          width: 100%;
          -webkit-transition: all 0.30s ease-in-out;
          -moz-transition: all 0.30s ease-in-out;
          -ms-transition: all 0.30s ease-in-out;
          -o-transition: all 0.30s ease-in-out;
          outline: none;
          border: 2px solid #DDDDDD;
        }
        input[type=text]:focus, textarea:focus {
          box-shadow: 0 0 5px rgba(81,152,238,1.00);
          border: 2px solid rgba(81,176,238,1.00);
        }
        input[type=submit] {
          border: 2px solid green;
        }
        .note {
          font-size: 15px;
          font-family: Helvetica, Arial, "
        sans-serif"
        }
        .enter {
          font-size: 16px;
        }
        </style>
        </head>
        <body>
        "
        ;
        set_time_limit(6000);
        /* max_execution_time(6000); // time in seconds */
        if ($_GET['xfer']) {
        if (
        $_POST['from'] == "") {
        print 
        "<a href="$PHP_SELF">Go back</a> - you need to enter a URL!";
        } else {

            if (
        $_POST['to'] == ""$filename basename(parse_url("$_POST[from]")['path']);
            else 
        $filename "$_POST[to]";

        copy("$_POST[from]""$filename");
        $size round((filesize($filename)/1000000), 3);
        print 
        "Transfer complete ($size MB):<br>
        <a href="
        $_POST[from]">$_POST[from]</a>
        <br>
        <a href="
        $filename">$filename</a><br>
        <br>
        <a href="
        $PHP_SELF">Transload more (go back)</a>
        "
        ;
        }
        } else {
        print 
        "<form action="$PHP_SELF?xfer=true" method=post>
        <b>URL of source file</b> (http://.. or https://..):<br>
        <span class=note><b>NOTE:</b> URLs with special characters like ~ etc. <b><i>must be encoded first</b></i>, e.g. over at <a href="
        http://www.blooberry.com/indexdot/html/topics/urlencoding.htm#rollown" target=_blank>Brian Wilson's URL Encoding page</a>!</span><br>
        <input type='text' name='from' value='' size='' autofocus><br>
        <
        i>optional</i>: save as (specify custom filename):<input type='text' name='to' size=''><br>
        <
        center><input type=submit value="Transload"><br>
        <
        span class=enter>or hit ENTER</span>
        </
        center>
        </
        form>
        </
        body>
        </
        html>
        ";
        }
        ?>
        Last edited by LeeBinder; 16.08.19, 21:15.

        Comment


          #5
          Fatal error : UTF-8 is not defined / expecting ; on line 7;

          Also by looking at the printed text / css that has been added, it looks like someone has made this script public access without adding any security lol

          Comment

          Working...
          X