If your host can handle PHP, I use this script. It comes with a few frills
that shows you information about the file you uploaded - you can safely
remove them.
The file upload form:
<form action="destination.php" enctype="multipart/form-data" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="51200">
File to Upload: <input type="file" name="fileupload"><br><br>
<input type="submit" value="upload!">
And here is what needs to be in destination.php :
<h1>File Upload Results</h1>
<?php
$file_dir = "C:\\upload\\"; //change this to the dir where they need to
go
foreach($_FILES as $file_name => $file_array) {
print "path: ".$file_array['tmp_name']."<br>\n";
print "name: ".$file_array['name']."<br>\n";
print "type: ".$file_array['type']."<br>\n";
print "size: ".$file_array['size']."<br>\n";
print "destination: ".$file_dir.$file_array[name]."<br>\n";
if (is_uploaded_file($file_array['tmp_name'])) {
move_uploaded_file($file_array['tmp_name'], $file_dir.$file_array[name])
or die ("Couldn't copy");
print "file was moved!<br><br>";
}
}
?>
"francisco navarro" <fnav (AT) prodigy (DOT) net.mx> wrote
Quote:
Hi:
I have a free space for publishing my pages that my internet provider
gives
to the costumers,
an I also use that space for store my designs and jobs (from clients, to
clients, providers etc.)
I'd like to do a page with an interface for uploading files, so I will
never
have to give clients ftp access
1st time I did that, never knew that is not that simple, like just
putting
an upload botton an the browse file box...
Does anybody can give me tip or explanation of relevant topics for
completing my homework. the server my provider uses is a windows nt I
think...so maybe this can help you regarding folders that I think I need
to
use for this matter.!....thanks in advanced.. |