•How to upload files using PHP?

Answer Posted / sei thu htun

Here is example code:
On HTML:
<form enctype="multipart/form-data" action="uploader.php"
method="POST">
<input name="uploadedfile" type="file" />
<input type="submit" value="Upload File" />
</form>

On PHP Script:

$target_path="YOUR_TARGET_PATH_FOR_STORE_UPLOAD_FILE_ON_SERVER";

if(@move_uploaded_file($_FILES['uploadedfile']['tmp_name'],
$target_path)) {
echo "Success";
} else{
echo "Error";
}

Is This Answer Correct ?    13 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what does the unset() function means?

566


Explain object-oriented methodology in php?

574


What is data abstraction in php?

566


Is php a case sensitive language?

599


What is the use of final class in php?

500






How I can control asset documents without GR/IR?

1199


What is session management php?

521


Is php a float?

529


What is the difference between query and inquiry?

483


Where do we use get and post?

519


What is the difference between Session and Cookie?

573


What is php in full?

495


What are the variables in php?

550


How to download and install php on windows?

595


How to concatenate two strings together in php?

554