Uploads ARE a little wierd, especially if you aren't used to php script. It works in a c-like way in some ways and like pascal if you remember that in some as well.
In this case, the upload happens as a course of the input field of the HTML form that would be in the placeholder. For example, here's the bit of code in one of my upload forms:
Code:
<form id="subForm" enctype="multipart/form-data" action="upload.php" method="post">
<p><label for="uploaded" class="label">Browse for a media file:</label>
<input type="file" name="uploaded" id="uploaded" /></p>
</form>
Then, in the upload.php, I have this part:
Code:
<?php
$mediafile = $_POST['uploaded'] ;
/* Set the name of the file based on what was in the form */
$target = "../../media/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
/* Determine if it worked or not (which actually does the upload and looks for an error */
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "The file ". $target. " has NOT been uploaded";
}
In this case, I've taken apart a script that works, so I don't know that this is everything, but it should get you pointed in the right direction. I found and deciphered this via a Google search.
Hope this helps. If it's completely Greek to you, you might need to hire someone because if it doesn't work at first attempt, without knowledge of the scripts, you will be frustrated trying to get it to work right.
Also, php has some limitations for file size by defaut, so when you are testing, use small text files or something...these can be fixed in the php.ini if you have access to it on your hosting account. And...there's no progress meter here, so you just have to wait for it to finish - give good page forwards or messages in the if/else to make sure the user knows what happened or didn't.
Bookmarks