Jump to content

problem related file uploading


dearmoawiz

Recommended Posts

hi guyzzzz

              howz u all i using following code for file uploading but wen i run it the message is that file already exists so can any body tell me wats problem ?

my file input field name is    res  !!!

  waiting

 

 

 

i debug it n i found the error that it didnt take any value in  $_FILES["res"]["name"]  this variable so plzz guide why it happening ...

 

if($_FILES["res"]["error"]>0)

{

echo "Error: ". $_FILES["res"]["error"];

}

else

  {

if(!file_exists("references/". $_FILES["res"]["name"]))

{

echo "File already Exists ";

}

 

else

  {

  move_uploaded_file($_FILES["res"]["tmp_name"],"references/". $_FILES["res"]["name"]);

}

 

  }

Link to comment
https://forums.phpfreaks.com/topic/102873-problem-related-file-uploading/
Share on other sites

i also done it with that way but again result same ...

          let me paste code again

 

 

if($_FILES["res"]["error"]>0)

{

echo "Error: ". $_FILES["res"]["error"];

}

else

  {

if(file_exists("references/". $_FILES["res"]["name"]))

{

echo "File already Exists ";

}

 

else

  {

  move_uploaded_file($_FILES["res"]["tmp_name"],"references/". $_FILES["res"]["name"]);

}

 

  }

 

 

here the out is    File Already Exists ... but wen i check the folder then there is no file in that folder n if i upload any new file than also message is same

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.