HighDots Forums  

Re: upload html file botton?

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Re: upload html file botton? in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ruy Asan
 
Posts: n/a

Default Re: upload html file botton? - 07-20-2003 , 08:41 AM






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..





Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.