Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Problems with POST FILE

Help
Anonymous
2010-05-27
2013-05-30

  • Anonymous
    2010-05-27

    Hello,

    I need help with uploading a file in a form.

    I wrote the following script:

    <?php
    include('Snoopy.class.php');
    $snoopy = new Snoopy;
    // Config
    $url                                        = "http://127.0.0.1/";
    // Global
    $snoopy->agent  = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)";
    $snoopy->cookies["ostube_pass"] = "My MD5 Password";
    $snoopy->cookies["user"]    = "My Username";
    $snoopy->cookies["PHPSESSID"]       = "";
    $snoopy->setCookies();
    // Login <-- works
    $login_url                      = $url . "login.php";
    $login_vars['login_username']       = 'My Username';
    $login_vars['login_password']       = 'My Password';
    $login_vars['login_submit_y']       = 'yes';
    $snoopy->submit($login_url, $login_vars);
    $snoopy->setCookies();
    // NOW THE PROBLEM
    // 
    // <form method="post" action="/upload99.php" enctype="multipart/form-data" id="form_upload" name="form_upload">
    //      <input id="upfile_0_id" type="file" maxlength="255" name="upfile_0" size="32" value="" />
    //      <input type="submit" name="upload_action" value="page2" />
    // </form>
    // Upload
    $snoopy->set_submit_multipart();
    $snoopy->submit($url . "upload99.php", 
                            array("upload_action" => "page2"), 
                            array("upfile_0" => dirname(__FILE__) . '/testimage.jpg'));
    

    Can anyone help me plz. I need to submit "filesize, filtype, .."?

    OK, you can see all you need in the code.

    first i login to my site (login.php). after this i send a post request to (upload99.php).
    the important thinks are:

    <input id="upfile_0_id" type="file" maxlength="255" name="upfile_0" size="32" value="" />
    <input type="submit" name="upload_action" value="page2" />

    thanks for any help

     

  • Anonymous
    2010-05-27

    hmm

    BB-CODE isn't working. i used

    SOMETHING HERE
    
     

  • Anonymous
    2010-05-27

    Hello,

    I need help with uploading a file in a form.

    I wrote the following script:

    <?php
    include('Snoopy.class.php');
    $snoopy = new Snoopy;
    // Config
    $url                                        = "http://127.0.0.1/";
    // Global
    $snoopy->agent  = "(compatible; MSIE 4.01; MSN 2.5; AOL 4.0; Windows 98)";
    $snoopy->cookies["ostube_pass"] = "My MD5 Password";
    $snoopy->cookies["user"]    = "My Username";
    $snoopy->cookies["PHPSESSID"]       = "";
    $snoopy->setCookies();
    // Login <-- works
    $login_url                      = $url . "login.php";
    $login_vars['login_username']       = 'My Username';
    $login_vars['login_password']       = 'My Password';
    $login_vars['login_submit_y']       = 'yes';
    $snoopy->submit($login_url, $login_vars);
    $snoopy->setCookies();
    // NOW THE PROBLEM
    // 
    // <form method="post" action="/upload99.php" enctype="multipart/form-data" id="form_upload" name="form_upload">
    //      <input id="upfile_0_id" type="file" maxlength="255" name="upfile_0" size="32" value="" />
    //      <input type="submit" name="upload_action" value="page2" />
    // </form>
    // Upload
    $snoopy->set_submit_multipart();
    $snoopy->submit($url . "upload99.php", 
                            array("upload_action" => "page2"), 
                            array("upfile_0" => dirname(__FILE__) . '/testimage.jpg'));
    

    Can anyone help me plz. I need to submit "filesize, filtype, .."?

    OK, you can see all you need in the code.

    first i login to my site (login.php). after this i send a post request to (upload99.php).
    the important thinks are:

    <input id="upfile_0_id" type="file" maxlength="255" name="upfile_0" size="32" value="" />
    <input type="submit" name="upload_action" value="page2" />
    

    thanks for any help

     

  • Anonymous
    2010-05-27

    wow, i tried another time with bb-code .

    this is a security hole if the forum shows " html ".