HTML - Text & File Upload Form
Looking for a form / script to place on an HTML page that will accept not only a number of fields (name, email, etc) but a file (MS Word, TXT, or PDF) as well. Contents can either be stored in a SQL database, saved on server, or emailed to an account. Any help is appreciated.
Similar TutorialsHi, I've encountered this problem, and been struggling for few hours. Thing is, I have a form with enctype="multipart/form-data" and 2 inputs with type "file" in it with names RequestForm[doc1] and RequestForm[doc2]. When I submit the form, only the first one of the fields is sent into $_POST. If i comment out the 1st field, then only the second is sent. This thing is just killing me! Could someone help? What might be wrong? And yes, I do need 2 inputs, not 1 multifile input. Hi guys. I'm hoping someone can help me out. I'm by no means a web developer, but owning a business I tend to learn a little of everything - probably just enough to be dangerous. I'm trying to post a page that will have survey questions for all the brides that come through our boutique. The form has to be able to handle the normal form stuff - text fields, check boxes, etc. - but it also has to upload a user selected file. The idea is to get a bunch of feedback as well as a shot of the bride in her wedding gown. So, we'll have testimonials and accompanying pics. (I'm warning about copyright issues on the form). A prize will be randomly awarded to one of the survey participants at the end of the whole thing... once the promo is over. So, I've got the form pretty much done. But, I need a script that can handle the results and stores the images in such a way that I know what survey it goes with... make sense? Help me out here, I'm stuck. If it helps, I'm using IXwebhosting's linux platform. Thanks everybody! So all I want to do is to make a form where I can upload files to my webserver. I'd just like to stick to plain old HTML if possible. I made the form and the page but the problem is that when I upload a file the form gets submitted properly and it goes to another web page that is set as the action on the form however the file is nowhere to be seen! I thought that the file would just automatically appear in the same directory that the html file where the submitting form is. So does anyone know where my file is? Thanks! hi just wondering if someone can look over this code i have below... i think something is wrong lol its not bouncing emails to me soooo i'm kinda lost i think i have 2 forms working in one which isnt good... but can i have text input and image upload in one form?? i know you guys will be like "man this chick has it all wrong" but be nice thanks in advance kel Code: <br><br><FORM METHOD=POST ACTION="mailto:a*****@***.com" ENCTYPE="text/plain"> Name: <br><TEXTAREA NAME="COMMENTS" ROWS=1 COLS=20> </TEXTAREA> <br> Address: <br><TEXTAREA NAME="COMMENTS" ROWS=5 COLS=20> </TEXTAREA> <br> Upload image here.. For Best Results use an image as close to 1500x1500px as possible: <br><FORM METHOD=POST ACTION="mailto:*****@***.com" ENCTYPE="multipart/form-data"> <INPUT TYPE="file" NAME="upload"> </FORM> <br> <INPUT TYPE="submit" VALUE="Send"> <INPUT TYPE="reset" VALUE="Clear"> <br> </form> <!-- ** END OF FORM ** --> Is there a way to put a custom graphic for the browse button in the file upload field, similar to how you can use a custom graphic for the submit button? Hey everyone i'm new here..great forum.. I really need your help, i've literally been trying all day to save the form information entered on my site to a text file of xml or any type of document but i have not gotten through at all.. I'm creating a site that provide a service to the users, i would like them to leave information so that i can contact them, such as name number location.. I created the forms but cant get the text they type into the forum to save..after doing some reading, i learn that i need to use a script like php to write the form info to the text file.. Can someone please please please help me..im so tried..lol.. Any help would be greatly appreciated.. The following common code is not working in Firefox (3.0.11). It works in Safari (4.02) and IE7. When I say not working, I mean that when I click the submit button, the address does not change to the form processing url: Code: <!-- The data encoding type, enctype, MUST be specified as below --> <form enctype="multipart/form-data" action="uploader.php" method="POST"> <!-- MAX_FILE_SIZE must precede the file input field --> <input type="hidden" name="MAX_FILE_SIZE" value="30000" /> <!-- Name of input element determines name in $_FILES array --> Send this file: <input name="mp3file" type="file" /> <input type="submit" name="submit" value="Send File" /> </form> The file uploader.php does nothing, it is blank, I'm merely trying to establish communication. Once again, the code functions in IE and Safari so I dont think this is PHP related. Hi Guys and Gals! Looking for a little help on this one... I use a service that allows me to upload up to 20 photos to each of my work orders. The upload screen is set up with 20 seperate "Browse" lines (1 for each photo). I have requested that the page be recoded to accept a range of photos in a single "Browse" line, as opposed to one line for each. This would really cut down on the "clicking time" involved in attaching photos to an order. Heres my problem...they tell me that it cant be done, and blame it on Internet Explorer capabilities or lack of... Is this true? And if so, does IE version 7 support this functionality? Here is the current code from the upload screen: HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <title>Attach Files to a Workorder</title> <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> <style type="text/css"> BODY { BACKGROUND-COLOR: linen; TEXT-ALIGN: center } </style> <script language="javascript"> <!-- function ConfirmDelete(filename){ var CompleteDelete = confirm("Are you sure you want to delete "+filename+"?"); if(CompleteDelete == true){window.location='MultipleFileUploads.aspx?id=123553&action=delete&filename='+filename} else{return false} } //--> </script> </HEAD> <BODY TEXT="1"> <div id="MultipleFileUploadForm"> <H3>Attachment Upload</H3> <div id=notesholder align=center style="text-align:left;width:600px;"> <UL> <LI> The files you upload here will not show as uploaded until you save your changes to the order. <LI> You cannot upload a file that is larger than 1MB <LI> All images that have a file size larger than 75KB will be automatically resized <LI> All images that have either a width or height greater than 640px will be resized proportionately <LI> All bitmap files will automatically be converted to JPGs <LI> All files will be renamed in the following format. ([Lastname]_[Firstname]_[JobNumber]_##.[extension]) </LI> </UL> </div> <form name="Form1" method="post" action="MultipleFileUploads.aspx?id=123553&Fname=Kracht&Lname=Jennifer&JobNum=1246607" id="Form1" enctype="multipart/form-data"> <input type="hidden" name="__VIEWSTATE" value="dDwtMzA1MTQwMjgyO3Q8O2w8aTwwPjtpPDE+Oz47bDx0PDtsPGk8MD47aTwyPjs+O2w8dDxAMDw7Ozs7Ozs7Ozs7Pjs7Pjt0PEAwPDs7Ozs7Ozs7Ozs+Ozs+Oz4+O3Q8cDxwPGw8VmlzaWJsZTs+O2w8bzx0Pjs+Pjs+O2w8aTwxPjs+O2w8dDw7bDxpPDA+O2k8MT47aTwyPjtpPDM+Oz47bDx0PEAwPHA8cDxsPERhdGFLZXlzO18hSXRlbUNvdW50Oz47bDxsPD47aTwyMD47Pj47Pjs7Ozs7Ozs7PjtsPGk8MD47aTwxPjtpPDI+O2k8Mz47aTw0PjtpPDU+O2k8Nj47aTw3PjtpPDg+O2k8OT47aTwxMD47aTwxMT47aTwxMj47aTwxMz47aTwxND47aTwxNT47aTwxNj47aTwxNz47aTwxOD47aTwxOT47PjtsPHQ8O2w8aTwwPjs+O2w8dDxAPEZpbGUgMTpcPC90ZFw+XD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8O2w8aTwwPjs+O2w8dDxAPEZpbGUgMTk6XDwvdGRcPlw8dGQgY29sc3Bhbj0iMiIgYWxpZ249InJpZ2h0Ilw+XDxpbnB1dCB0eXBlPWZpbGUgbmFtZT1maWxlIHN0eWxlPSJ3aWR0aDo0MDAiIGlkPWZpbGVcPjs+Ozs+Oz4+O3Q8O2w8aTwwPjs+O2w8dDxAPEZpbGUgMjA6XDwvdGRcPlw8dGQgY29sc3Bhbj0iMiIgYWxpZ249InJpZ2h0Ilw+XDxpbnB1dCB0eXBlPWZpbGUgbmFtZT1maWxlIHN0eWxlPSJ3aWR0aDo0MDAiIGlkPWZpbGVcPjs+Ozs+Oz4+Oz4+O3Q8cDxwPGw8VGV4dDs+O2w8S3JhY2h0Oz4+Oz47Oz47dDxwPHA8bDxUZXh0Oz47bDxKZW5uaWZlcjs+Pjs+Ozs+O3Q8cDxwPGw8VGV4dDs+O2w8MTI0NjYwNzs+Pjs+Ozs+Oz4+Oz4+Oz4+Oz4AnCFSfdJrtisPv3L2YbwsLOQZAw==" /> <table id="dlFORM" cellspacing="0" border="0" style="border-collapse:collapse;"> <tr> <td> File 1:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 2:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 3:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 4:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 5:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 6:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 7:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 8:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 9:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 10:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 11:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 12:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 13:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 14:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 15:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 16:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 17:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 18:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 19:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr><tr> <td> File 20:</td><td colspan="2" align="right"><input type=file name=file style="width:400" id=file> </td> </tr> </table> <br><br> <input name="Submit1" id="Submit1" type="submit" value="Upload Files" /> <BUTTON onclick="window.location='MultipleFileUploads.aspx?id=123553&action=viewall'" type=button>View All</BUTTON> <BUTTON onclick="window.close()" type=button>Close Window</BUTTON> </form> </div> <table align=center style="width:600px;"> <tr> <td align=left> </td> </tr> </table> </BODY> </HTML> could some one please tell how to upload a file without using the submit button. Iknow the location of the file and i want to upload the file into the server I have a browse button when user selects a file i want to display the files attached in a table with attached filename and date. can anybody tell me how to generate table dynamically. Hi, I have been using ext its really fun working on it. Question:-- How can I upload a (*.jpg,*.bmp etc) file from browser to java webserver and store the file in some temporary folder(so that form webserver I could upload the file to my application server). Ur repsonse can help me analyze the problem and its possible solutions. Thanks I am trying to write a html form in which i want to provide a default file to be uploded from the clients computer. i tried doing it by setting the value attribute to a file in some location. However that file does not get uploaded.... can anybody help Hi! I found out that file_names are not encoded properly when performing a HTTP multipart/form-data request. (It does not encode according to the encode type that we specify) I created a small web page which contains a input tag (file type) and tried a combination of "Enctype" and "accept-charset" in the form tag and nothing seems to work. Please find my tries in the attached zip file. (Please do change the action URL to one that is working, before you test). The RTF files contain the HTTP request header that I captured when the page is loaded from Chrome, Firefox, MSIE. Is there a way for me to fix this? /Boo Hello! I need a bit of help with some website programming! What I simply need to accomplish is; to upload some text, and overwrite an existing text file! I would prefer HTML and Javascript - it should be as easy as possible! Have tried Google, but no luck -Thanks in advance! I need an way to upload a file by clicking a link instead of button(<input type="file" name="somename"/>). This feature has been newly added to GMail, to attached a file we need to click a link. Any ideas or code of how this can be done are needed. Thanks Hi all, how can i upload a file and when i click the submit button i go automatically to other web page. I am using some code that uploads the file perfectly, but i can't get a way to go to other page when i click the submit button. If someone can help me giving me an example of how to do that, or tell me what to change in my code i'll appreciate any kind of help. Here is my code: PHP Code: <?php function error($errorMsg) { ?> <script> alert("<?php echo $errorMsg;?>"); </script> <?php } global $folder; $folder = "uploaded"; if(!is_dir($folder)) if(!mkdir($folder)) { error("Can't, neither, access, nor create, the upload folder"); die(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <style> body { background-color:#000000; } </style> <title>Upload</title> </head> <body> <center><h1><font color = "#FFFFFF" > Upload </font></h1></center> <?php function mainPage() { ?> <iframe style="display:none" name="fileUploader"></iframe> <form method="POST" target="fileUploader" enctype="multipart/form-data" action="?action=fileUploader"> <div><input name="file" type="file" STYLE="color:#FFFFFF; size="60"></div> <input type="submit" value="Upload" > </form> <?php } function fileUploader() { global $folder; function storeFile($folder,$tmpFileName,$fileName) { if(!is_uploaded_file($tmpFileName)) { error("Invalid file"); return; } if(!move_uploaded_file($tmpFileName, $folder . "/" . $fileName )) { error("Can't move uploaded file to destination"); return; } } foreach ($_FILES as $file) storeFile("uploaded",$file["tmp_name"],$file["name"]); } $actions = array("fileUploader" => 1,"fileLoader"=> 1); if (!isset($_GET['action'])) { //If not isset -> set with dumy value $_GET['action'] = "undefine"; } $action = $_GET["action"]; if($actions[$action]) $action(); else mainPage(); ?> </body> </html> I have several websites that I maintain and update. A lot of them are just textual changes and I would think my customers can do these themselves by editing a simple .txt file. I was hoping my choices are avalable so that I can just insert this tag into my web pages and then give them login info to their edit page or show them how to upload the .txt file. I hope this is an easy one with several answers. Is it possible these tags could discipline your rankings in the search engines? Thanks, Jason I've recently been trying to create my own upload form. (i know the html for it, ect) But I'm havening trouble with it uploading to the directory I tell it to go to... So, how do you write/ make a upload form. (as mine is not working ) Hi Everyone. hope your all having a great day. i would like to get some help here with image uploading feature on my site. i would like to have my customers be able to upload an image directly from my site. with the upload which will be sent directly to a secure directory on my server i would like the customer to be able to enter an e-mail address and maybe a small msg as well. i been looking all over the net and can't find anything. i did find this code. <input type="file" /> but thats all. its dead. it leads to no where. no direction to where to upload or anything at all. anyhelp would be greatly apprciated. |