Working with images

When added with images, the name is <name><format>, but should be <name>.<format>
Here is the piece of code responsible for this:

echo ($up_file);
if (is_uploaded_file($_FILES['myfile']['tmp_name']))
if (!file_exists($file_path))

And one more question: how to correctly specify the path in $dir=’/bol/img/’;
And then he writes an error:

Warning: move_uploaded_file(localhost/bol/img/791jpeg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampplite\htdocs\bol\admin\img.php on line 45
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampplite\tmp\php5AC3.tmp' to 'localhost/bol/img/791jpeg' in C:\xampplite\htdocs\bol\admin\img.php on line 45

If at all the full path of this folder is C:\xampplite\htdocs\bol\img

Answer 1, authority 100%

In the code (in the question which) you need to fix the line




Answer 2, authority 50%

Your code should look something like this:

 $myfile = $_FILES["myfile"]["tmp_name"];
 $myfile_name = $dir.$_FILES["myfile"]["name"];
 if(move_uploaded_file($_FILES['myfile']['tmp_name'], $myfile_name))
      echo "Upload ok";
   echo "error Move file";