[SOLVED] Trying to figure out an upload script
Posted: Tue Jan 11, 2005 9:15 pm
Hi guys,
I have a form that allows the site's owners to upload image files and associate them with entries in the database. I have the database side of things working: the file path is stripped down and added to the database so that it can be used to refernece the file in the output page. Now I'm stuck on the bit where I actually upload the files.
I have the following form:
In the processing page, I currently have the following code:
Theoretically, and certainly going by other things I've read online, this ought to be uploading the file. I got the file path from my FTP program - that's where it says the folder lives - but I'm still not sure if this is correct. At any rate, the file that I tried to pass through the first file field is not being uploaded.
Can someone please tell me what I'm doing wrong? I've tried numerous upload scripts from different sources, and can't get any of them to work.
Cheers,
Seona.
I have a form that allows the site's owners to upload image files and associate them with entries in the database. I have the database side of things working: the file path is stripped down and added to the database so that it can be used to refernece the file in the output page. Now I'm stuck on the bit where I actually upload the files.
I have the following form:
Code: Select all
<form action="act_editCategory.php" method="post" name="editCategoryForm" id="editCategoryForm">
<input type="hidden" name="ID" value="<?php print $rowї"ID"]; ?>" />
<label for="CategoryName">Category Name:</label>
<input name="CategoryName" type="text" id="CategoryName" value="<?php print $rowї"CategoryName"]; ?>" />
<label for="Image">Title Image:</label>
<input name="Image" type="file" id="Image" />
<label for="Image1">Image 1:</label>
<input name="Image1" type="file" id="Image1" />
<label for="Image2">Image 2:</label>
<input name="Image2" type="file" id="Image2" />
<input type="submit" value="Edit Category" />
</form>Code: Select all
$path1 = "/var/www/html/_images/db_titles/" . $_FILESї'Image']ї'name'];
if (is_uploaded_file($_FILESї'Image']ї'name'])) {
move_uploaded_file($_FILESї'Image']ї'tmp_name'], $path1);
}Can someone please tell me what I'm doing wrong? I've tried numerous upload scripts from different sources, and can't get any of them to work.
Cheers,
Seona.