FaLgoR 0 Report post Posted January 17, 2005 Here, I'll show you how to upload files to the server by your browser.upload.php: <?$sizelimit = "280000"; // file size limit$patch = "/home/yoursite/public_html/files"; // patch to where the uploaded files will be saved - change itif($file != ""){ // if $file is set$file_ext = explode(".",$file_name); // check for the extensionif($file_size > $sizelimit) // check if file size is bigger than the limitdie("This file is too big.");if(($file_ext[1] == "exe") && ($file_ext[1] == "bat")) // check for invalid files: add how extensions you wantdie("File extension forbidden!");if(file_exists("$patch/$file_name")) // check if this file is already in your serverdie("There is another file with the same name in this server!");if($file_ext[2]) // file.hi.exe - it is for security that this files will not be uploadeddie("Invalid file name!");$title = stripslashes($title); // security reasons$file_name = stripslashes($file_name); // security reasons$file_size = stripslashes($file_size); // security reasons$description = stripslashes($description); // security reasonsif(@copy($file,"$patch/$file_name")) // if the file has been suceful uploadeddie("<p align=\"center\">The file has been uploaded!<br><Br><a href=\"index.php\">Back to the main page</a><br><a href=\"upload.php\">Send another file</a></p>"); // show this message}else{ // if the file isn't set, show the form?><form action="<? echo "$PHP_SELF"; ?>" method="post" enctype=multipart/form-data><table border="0"><tr><td width="100">File:</td><td><input type="file" name="file" size="30"></td></tr></table><p align="center"><input type="submit" value="Send file"></p></form><?}?> Well here we are! It can be used for an "Send your file" pages for members, but remember that this code can be dangerous if not used with security. I hope this code don't create much problems just like my topic with an login sistem, but, if u find any problems, post it here.Thx Share this post Link to post Share on other sites