Loading ...
Sorry, an error occurred while loading the content.
 

why is_uploaded_file() fails randomly

Expand Messages
  • RUFUS
    Hello people. I am using the is_uploaded_file() But if fails at times . can anybody suggest me on what could be the reasons for it.
    Message 1 of 5 , Sep 27, 2007
      Hello people.

      I am using the is_uploaded_file()

      But if fails at times . can anybody suggest me on what could be the
      reasons for it.

      if(isset($_REQUEST['action'])){
      echo "submitted";

      $tempName = $_FILES["user_image"]["tmp_name"];
      if (is_uploaded_file($tempName)){
      echo "Yes Uploaded <br>";
      }else{
      echo "Not Uploaded is_uploaded_file() failed <br>";
      }

      }
      ?>
      <form name="form_main" method="post" enctype="multipart/form-data"
      action="<?php echo $_SERVER['PHP_SELF'];?>">
      <table width='100%'><tr><td valign='top'>
      <table width='75%' align='center' cellpadding=5 cellspacing=1>
      <tr class='user2'><td><b>Image : </b></td><td><input type="file"
      name="user_image" size="40"></td></tr>
      <tr class='user2'><td> </td><td><INPUT TYPE="submit"
      name="action" value="submit"></td></tr>
      </table>
      </td></tr></table>
      </form>


      I get the message from the else part.

      Not Uploaded is_uploaded_file() failed


      please reply.
    • bhavna patel
      hi, check your php.ini file file_uploads = on is there or you are uploading more than the size defined in upload_max_filesize = 2M change either of these
      Message 2 of 5 , Sep 27, 2007
        hi,

        check your php.ini file
        file_uploads = on

        is there or you are uploading more than the size defined in
        upload_max_filesize = 2M

        change either of these settings and then try

        Regards,
        Bhavna.


        ----- Original Message ----
        From: RUFUS <sufur_2000@...>
        To: bang-phpug@yahoogroups.com
        Sent: Thursday, September 27, 2007 1:23:44 PM
        Subject: [bang-phpug] why is_uploaded_file() fails randomly

        Hello people.

        I am using the is_uploaded_ file()

        But if fails at times . can anybody suggest me on what could be the
        reasons for it.

        if(isset($_REQUEST[ 'action'] )){
        echo "submitted";

        $tempName = $_FILES["user_ image"][" tmp_name" ];
        if (is_uploaded_ file($tempName) ){
        echo "Yes Uploaded <br>";
        }else{
        echo "Not Uploaded is_uploaded_ file() failed <br>";
        }

        }
        ?>
        <form name="form_main" method="post" enctype="multipart/ form-data"
        action="<?php echo $_SERVER['PHP_ SELF'];?> ">
        <table width='100%' ><tr><td valign='top' >
        <table width='75%' align='center' cellpadding= 5 cellspacing= 1>
        <tr class='user2' ><td><b>Image : </b></td><td> <input type="file"
        name="user_image" size="40"></ td></tr>
        <tr class='user2' ><td>  </td><td> <INPUT TYPE="submit"
        name="action" value="submit" ></td></tr>
        </table>
        </td></tr></ table>
        </form>

        I get the message from the else part.

        Not Uploaded is_uploaded_ file() failed

        please reply.






        ____________________________________________________________________________________
        Yahoo! oneSearch: Finally, mobile search
        that gives answers, not web links.
        http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

        [Non-text portions of this message have been removed]
      • RUFUS
        Thank you so much for your response bhavana.. The thing is the file_uploads is on in the php.ini file.. moreover. the files are not uploading only at times not
        Message 3 of 5 , Sep 27, 2007
          Thank you so much for your response bhavana..

          The thing is the file_uploads is on in the php.ini file..
          moreover. the files are not uploading only at times not always....

          And am uploading the files which is lesser in size than what i have
          specified in my MAX_FILE_SIZE..

          so could be the other reasons... Please reply..



          --- In bang-phpug@yahoogroups.com, bhavna patel <bhavna_coolinus@...>
          wrote:
          >
          > hi,
          >
          > check your php.ini file
          > file_uploads = on
          >
          > is there or you are uploading more than the size defined in
          > upload_max_filesize = 2M
          >
          > change either of these settings and then try
          >
          > Regards,
          > Bhavna.
          >
          >
          > ----- Original Message ----
          > From: RUFUS <sufur_2000@...>
          > To: bang-phpug@yahoogroups.com
          > Sent: Thursday, September 27, 2007 1:23:44 PM
          > Subject: [bang-phpug] why is_uploaded_file() fails randomly
          >
          > Hello people.
          >
          > I am using the is_uploaded_ file()
          >
          > But if fails at times . can anybody suggest me on what could be the
          > reasons for it.
          >
          > if(isset($_REQUEST[ 'action'] )){
          > echo "submitted";
          >
          > $tempName = $_FILES["user_ image"][" tmp_name" ];
          > if (is_uploaded_ file($tempName) ){
          > echo "Yes Uploaded <br>";
          > }else{
          > echo "Not Uploaded is_uploaded_ file() failed <br>";
          > }
          >
          > }
          > ?>
          > <form name="form_main" method="post" enctype="multipart/ form-data"
          > action="<?php echo $_SERVER['PHP_ SELF'];?> ">
          > <table width='100%' ><tr><td valign='top' >
          > <table width='75%' align='center' cellpadding= 5 cellspacing= 1>
          > <tr class='user2' ><td><b>Image : </b></td><td> <input type="file"
          > name="user_image" size="40"></ td></tr>
          > <tr class='user2' ><td>  </td><td> <INPUT TYPE="submit"
          > name="action" value="submit" ></td></tr>
          > </table>
          > </td></tr></ table>
          > </form>
          >
          > I get the message from the else part.
          >
          > Not Uploaded is_uploaded_ file() failed
          >
          > please reply.
          >
          >
          >
          >
          >
          >
          >
          ____________________________________________________________________________________
          > Yahoo! oneSearch: Finally, mobile search
          > that gives answers, not web links.
          > http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
          >
          > [Non-text portions of this message have been removed]
          >
        • Vinu Thomas
          There are two settings in php.ini which control the size of files which can be uploaded: post_max_size http://in.php.net/ini.core#ini.post-max-size
          Message 4 of 5 , Sep 27, 2007
            There are two settings in php.ini which control the size of files
            which can be uploaded:

            post_max_size
            http://in.php.net/ini.core#ini.post-max-size
            upload_max_filesize
            http://in.php.net/ini.core#ini.upload-max-filesize

            Both these will have to be set to a size greater than the file size
            you want to upload.

            If these don't work, the might be a permission issus with the temp
            folder where php uploads the file.

            Regards,
            Vinu

            --- In bang-phpug@yahoogroups.com, "RUFUS" <sufur_2000@...> wrote:
            >
            > Thank you so much for your response bhavana..
            >
            > The thing is the file_uploads is on in the php.ini file..
            > moreover. the files are not uploading only at times not always....
            >
            > And am uploading the files which is lesser in size than what i have
            > specified in my MAX_FILE_SIZE..
            >
            > so could be the other reasons... Please reply..
            >
            >
            >
            > --- In bang-phpug@yahoogroups.com, bhavna patel <bhavna_coolinus@>
            > wrote:
            > >
            > > hi,
            > >
            > > check your php.ini file
            > > file_uploads = on
            > >
            > > is there or you are uploading more than the size defined in
            > > upload_max_filesize = 2M
            > >
            > > change either of these settings and then try
            > >
            > > Regards,
            > > Bhavna.
            > >
            > >
            > > ----- Original Message ----
            > > From: RUFUS <sufur_2000@>
            > > To: bang-phpug@yahoogroups.com
            > > Sent: Thursday, September 27, 2007 1:23:44 PM
            > > Subject: [bang-phpug] why is_uploaded_file() fails randomly
            > >
            > > Hello people.
            > >
            > > I am using the is_uploaded_ file()
            > >
            > > But if fails at times . can anybody suggest me on what could be the
            > > reasons for it.
            > >
            > > if(isset($_REQUEST[ 'action'] )){
            > > echo "submitted";
            > >
            > > $tempName = $_FILES["user_ image"][" tmp_name" ];
            > > if (is_uploaded_ file($tempName) ){
            > > echo "Yes Uploaded <br>";
            > > }else{
            > > echo "Not Uploaded is_uploaded_ file() failed <br>";
            > > }
            > >
            > > }
            > > ?>
            > > <form name="form_main" method="post" enctype="multipart/ form-data"
            > > action="<?php echo $_SERVER['PHP_ SELF'];?> ">
            > > <table width='100%' ><tr><td valign='top' >
            > > <table width='75%' align='center' cellpadding= 5 cellspacing= 1>
            > > <tr class='user2' ><td><b>Image : </b></td><td> <input type="file"
            > > name="user_image" size="40"></ td></tr>
            > > <tr class='user2' ><td>  </td><td> <INPUT TYPE="submit"
            > > name="action" value="submit" ></td></tr>
            > > </table>
            > > </td></tr></ table>
            > > </form>
            > >
            > > I get the message from the else part.
            > >
            > > Not Uploaded is_uploaded_ file() failed
            > >
            > > please reply.
            > >
            > >
            > >
            > >
            > >
            > >
            > >
            >
            ____________________________________________________________________________________
            > > Yahoo! oneSearch: Finally, mobile search
            > > that gives answers, not web links.
            > > http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
            > >
            > > [Non-text portions of this message have been removed]
            > >
            >
          • bhavna patel
            Hi, I don t y its not working may be some minor mistake but one think i would like to suggest is that check your php version bcoz its really depends on version
            Message 5 of 5 , Sep 27, 2007
              Hi,

              I don't y its not working may be some minor mistake but one think i would like to suggest is that check your php version
              bcoz its really depends on version too...
              check bellow link it may help you out.

              http://de3.php.net/manual/da/function.is-uploaded-file.php

              RG,
              Bhavna.


              ----- Original Message ----
              From: RUFUS <sufur_2000@...>
              To: bang-phpug@yahoogroups.com
              Sent: Friday, September 28, 2007 6:55:59 AM
              Subject: [bang-phpug] Re: why is_uploaded_file() fails randomly

              Thank you so much for your response bhavana..

              The thing is the file_uploads is on in the php.ini file..
              moreover. the files are not uploading only at times not always....

              And am uploading the files which is lesser in size than what i have
              specified in my MAX_FILE_SIZE. .

              so could be the other reasons... Please reply..

              --- In bang-phpug@yahoogro ups.com, bhavna patel <bhavna_coolinus@ ...>
              wrote:
              >
              > hi,
              >
              > check your php.ini file
              > file_uploads = on
              >
              > is there or you are uploading more than the size defined in
              > upload_max_filesize = 2M
              >
              > change either of these settings and then try
              >
              > Regards,
              > Bhavna.
              >
              >
              > ----- Original Message ----
              > From: RUFUS <sufur_2000@ ...>
              > To: bang-phpug@yahoogro ups.com
              > Sent: Thursday, September 27, 2007 1:23:44 PM
              > Subject: [bang-phpug] why is_uploaded_ file() fails randomly
              >
              > Hello people.
              >
              > I am using the is_uploaded_ file()
              >
              > But if fails at times . can anybody suggest me on what could be the
              > reasons for it.
              >
              > if(isset($_REQUEST[ 'action'] )){
              > echo "submitted";
              >
              > $tempName = $_FILES["user_ image"][" tmp_name" ];
              > if (is_uploaded_ file($tempName) ){
              > echo "Yes Uploaded <br>";
              > }else{
              > echo "Not Uploaded is_uploaded_ file() failed <br>";
              > }
              >
              > }
              > ?>
              > <form name="form_main" method="post" enctype="multipart/ form-data"
              > action="<?php echo $_SERVER['PHP_ SELF'];?> ">
              > <table width='100%' ><tr><td valign='top' >
              > <table width='75%' align='center' cellpadding= 5 cellspacing= 1>
              > <tr class='user2' ><td><b>Image : </b></td><td> <input type="file"
              > name="user_image" size="40"></ td></tr>
              > <tr class='user2' ><td>  </td><td> <INPUT TYPE="submit"
              > name="action" value="submit" ></td></tr>
              > </table>
              > </td></tr></ table>
              > </form>
              >
              > I get the message from the else part.
              >
              > Not Uploaded is_uploaded_ file() failed
              >
              > please reply.
              >
              >
              >
              >
              >
              >
              >
              ____________ _________ _________ _________ _________ _________ _
              > Yahoo! oneSearch: Finally, mobile search
              > that gives answers, not web links.
              > http://mobile. yahoo.com/ mobileweb/ onesearch? refer=1ONXIC
              >
              > [Non-text portions of this message have been removed]
              >






              ____________________________________________________________________________________
              Be a better Heartthrob. Get better relationship answers from someone who knows. Yahoo! Answers - Check it out.
              http://answers.yahoo.com/dir/?link=list&sid=396545433

              [Non-text portions of this message have been removed]
            Your message has been successfully submitted and would be delivered to recipients shortly.