July 22, 200818 yr Hey, I need to make a form which will have a mandatory option to upload a word document and when clicked on submit it should mail the word document to a specified email address, can anyone help me out with this. Thank you, The Full Stop
July 22, 200818 yr Hi We could write this for you in PHP. You can contact us by email at sales at n3wmedia dot com to discuss. Thanks Ed
July 22, 200818 yr hi try this file.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> </head> <body> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Choose a file to upload: <input name="uploadedfile" type="file" /><br /> <input type="submit" value="Upload File" /> </form> </body> </html> uploader.php <?php // Where the file is going to be placed $target_path = "uploads/"; /* Add the original filename to our target path. Result is "uploads/filename.extension" */ $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); $_FILES['uploadedfile']['tmp_name']; $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } ?> you will need put a file on server called uploads and i think one called tmp_name this is the script i am using it works to put an image into te uploadsfile on te server i havent worked out how to retrive it yet though good luck
Create an account or sign in to comment