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
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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.