Advertisement
Eather

File upload error...

Dec 9th, 2011
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. $un=mysql_escape_string($this->input->post('uni_name'));
  2. $tm=mysql_escape_string($this->input->post('team_name'));
  3.  
  4.             //end
  5.             //file upload
  6. $pa="";
  7.             if($_FILES["team_photo"]["type"]!='application/zip' ||
  8. $_FILES["team_photo"]["type"]!='application/rar') {
  9.                 $error="File format error. Please choose zip/rar file";
  10.             }
  11.             else if($_FILES["team_photo"]["size"]>10500) {
  12.                 $error="File is too large.";
  13.             }
  14.             else {
  15.                 $pa="images/ProgrammingContest";
  16.  
  17.                 //here a new folder will create as the name of $un
  18.  
  19.                 move_uploaded_file($_FILES["team_photo"]["tmp_name"],$pa.'/'.$un.'/'.$tm.'.zip');
  20.  
  21.  
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement