# How can I create an 'Upload' section on my website



## Ha11ett

Hi, I'm thinking about starting up a website for primary school teachers (like me) that allows people to upload and share their teaching resources.

Basically a website that teachers can navigate through to find teaching resources for a specific topic

Is there a way that i can create a website that is self sufficient, in that people can upload files on their own (onto pre created pages that are split into sections) without the need for them to have to email myself so that i could upload them?

Or will i have to get them to email the file to me?

Thanks, Chris


----------



## gamerman0203

HTML forms have their own upload feature. Research for it will only take a few minutes. I have never used it myself so I won't be of much help.


----------



## foolygoofy26

*Uploading files*

The line that you are looking for is

<input type="file" name="file" />

Make sure that you have a form

<form method="post" action="thePage.extention">
other fields
<input type="file" name="file" />
some more field and radio buttons perhaps here.
finally a submit button.
</form>

in the action thePage must contain a script to upload things to your server. It all depend to the language that you will be using, ASP.NET, PHP, Perl, etc.


----------



## rkp.sreepadmam

i need a index file and php file for uploading resumes (doc files) to my website please help


----------



## Freeda

According to php tutorials this script will allow you to upload files from your browser to your hosting, using PHP. The first thing you need to do is create an HTML form that allows people to choose the file they want to upload.



Code:


<form enctype="multipart/form-data" action="upload.php"
method="POST">
Please choose a file:
<input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>

This form sends data to the file "upload.php", which is what we will be creating next to actually upload the file.

The actual file upload is:


PHP:


<?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else {
echo "Sorry, there was a problem uploading your file.";
}
?>


----------

