-2

I am beginner with php.

I found out that the best tool to work with MySQL database and files is php.

So I need to get file from 'file_name'

<input type=file name="file_name">

and to save this file into another place. For example at d:/folder/

Tell me please how can I do it in php. Or there is another way to solve this issue

3

2 Answers 2

0
$target_dir = "uploads/"; // folder path
$target_file = $target_dir . basename($_FILES["fileToUpload"]["file_name"]);
move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file);

follow this tutorial: http://www.w3schools.com/php/php_file_upload.asp

Sign up to request clarification or add additional context in comments.

Comments

0

Make sure to add enctype="multipart/form-data" in html form tag. Otherwise you won't get $_FILE arr

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.