<?
if (isset($users_file)) {
echo "<B>Remote File Name:</B> $users_file<BR>";
echo "<B>Local File Name:</B> $users_file_name<BR>";
echo "<B>Local File Size:</B> $users_file_size<BR>";
if (isset($users_file_type)) {
echo "<B>Local File Type:</B> $users_file_type<P>"; }
$doc_directory = "/my/dir/here/";
$my_file = "".$users_file_name;
$copy_path = $doc_directory.$my_file;
if ($users_file != "none") {
if(!copy($users_file, $copy_path)) {
echo "File upload failed!"; }
else { ?><A HREF="<? echo $my_file; ?>">Upload Complete!</A><br><br><a href="display.php">View files</a>
<br><a href="upload.php">Upload another file</a>
<? } }
else { echo "<P>You must select a file to upload!<P>"; ?>
<A HREF="<? echo $PHP_SELF; ?>"><B>Back</B></A> to the Upload Form
<? } }
else { ?>
<form action="<? echo $PHP_SELF; ?>"
enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="20000" />
<input type="file" name="users_file" /><br />
<input type="submit" value="Upload!" />
</form><? } ?>
That is my script. I'm kind of confused at TTT's post. Would I want to incorporate what he said into my script or what. See, I'm letting friends upload images to my server and I wrote a little script that displays them with an auto generating gui .. aside from the unncessary details.. I basically just want to limit how many kilobytes they can upload into their directory set aside for them.
I want the upload script to check the directory and make his it has less than their alotted bytage before it allows them to upload. Is this making sense 😕