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

Re: [bang-phpug] file upload form not working

Expand Messages
  • Koushik G raj
    Kamal Peter, may be html form tag doesn t have enctype= multipart/form-data attribute. ... From: kamal kanth Subject: [bang-phpug]
    Message 1 of 2 , Nov 6, 2009
      Kamal Peter,

      may be html form tag doesn't have enctype="multipart/form-data" attribute.

      --- On Fri, 6/11/09, kamal kanth <kamalpeters@...> wrote:

      From: kamal kanth <kamalpeters@...>
      Subject: [bang-phpug] file upload form not working
      To: bang-phpug@yahoogroups.com
      Date: Friday, 6 November, 2009, 11:30 AM







       









      Hi everyone,

      A file upload form that was working fine for a long time, suddenly fail to upload file online.

      The $_FILES[] array just shows 0 bytes but able to see the attached file name.

      Here is the code which works local but not online..



      if ($_FILES['upfile1' ]['size'] > 0)

      {

          $file_name = ($_FILES['upfile1' ]['name'] );

          $first_part = substr($file_ name,0,-5) ;   

          $ext = findexts ($_FILES['upfile1' ]['name'] );    // calling the function to get file extension

          $ran = rand();

          $ran2 = $first_part. "-".date( "d-m-y-h- i-s")."." ;



          $target_path = "../attachments/ ";

          $target_path = $target_path . $ran2.$ext;



          if(move_uploaded_ file($_FILES[ 'upfile1' ]['tmp_name' ], $target_path) )

          {

              $filename1 = $ran2.$ext;

              $file = "http://".$_ SERVER['HTTP_ HOST']."/ attachments/ ".$filename1;

              $file_attach = "<a href='$file' >$file</a> ";

          }

          else{

              echo "not uploaded";

          }

      }



      Please do revert for some suggestions.



      Kamal Peter

      Mob: 9845400442



      [Non-text portions of this message have been removed]























      Now, send attachments up to 25MB with Yahoo! India Mail. Learn how. http://in.overview.mail.yahoo.com/photos

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