HTML - How Do You Identify A File In The Post Data?
When parsing the POST data from an input form, how do you identify a uploaded file? My first guess is that the Content-Disposition header field will contain a filename parameter, but I don't want to just make that assumption. When I dissect some POST data, it looks like this...
Code: -----------------------------7d721bbb0272 Content-Disposition: form-data; name="data1" 1 -----------------------------7d721bbb0272 Content-Disposition: form-data; name="myfile"; filename="X:\myfile.txt" Content-Type: text/plain mary had a little lamb with fleece as white as snow -----------------------------7d721bbb0272 Content-Disposition: form-data; name="start_date" -----------------------------7d7d37b0272 Content-Disposition: form-data; name="submit" Submit -----------------------------7d7d37b0272-- I highlighted the filename parameter. That's what I'm planning on keying in on. Is this right? Darren Similar TutorialsSo I've got a form with some input text. In addition to the data in the input text I want to send some other data that has already been predetermined on initial page load. How would I declare the other data within the form element? Thanks Hi there! I've been googleing for this for a while now, but I couldn't find any solution. My problem is simple. I want my forms to be in a way that browsers 'know' that the data being typed into the form is to be sent with the Unicode UTF-8 encoding. So that every data POSTed back to my server is encoded using UTF-8. How can I do that? Thanks in advance, AvoC. Hello all! Can anyone shoot me over some quick code here. What i need to do is simply have one text box and one combobox. When the person fills in the info for the 2 and clicks submit, text appears under the button (like for a thank you) and the info gets sent to my email. can anyone shoot me over some code here, i need this really bad for a part on my site, but i dont know how to do it. thanks! Hey all, This is probably a stupid question, but it's driving me nuts - I have a simple form with 2x file uploads on it, and when the user clicks a button a PHP script is run. This scrip is picked up by checking the global $_POST variable for 'upload'. This works fine and my PHP script does the upload when I only select one file (using either one), but when both are filled in for some reason the global $_POST variable is empty, so my script will not run. Before looking down the PHP route I'm wondering if everything is ok with my form, or if there is some error that I am missing that is causing this problem? Any help is greatly appciated. Thanks. Code: <form action="" method="post" name="client-balances-selection" enctype="multipart/form-data"> <div id="current-balances"> <h3>Current client balances</h3> <input type="file" name="current_balances" class="file_upload" /> </div> <div id="past-balances"> <h3>Past client balances</h3> <input type="file" name="past_balances" class="file_upload" /> </div> <input type="submit" name="upload" class="button-primary" value=<?php _e('Compare'); ?> /> <input type="submit" name="delete" class="button-delete" value=<?php _e('Delete old files'); ?> /> </form> Hi Everyone, I am trying to create a generic Form model for taking user input and storing an XML file in a database. I can only use JSP, Java, and HTML functionality which is already installed on the server, so new mods or plug ins are out. To do this, I need to group fields with a common parent together, and fieldsets are a natural way to do this. Is it possible to discover, using JSP or another method, which fieldset encompassed a given form field? Take the following example: XML Structu Code: <server name="myserver01"> <elements> <serverAttr attr1="myAttrbiute"> <serverAttr attr2="myAttr2"> </elements> </server> <server name="myserver02"> <elements> <servertAttr attr1="another attribute"> </elements> </server> ... To gather the data, I have an HTML form where users may add any number of server attributes (including 0) to a given server which they also define. example/pseudo-code shown he HTML Code: <fieldset> <Legend accesskey="Server1">Define a Server</Legend> Server Logical name : <input type="text" size="30" name="serverName"> Attribute: <input type="text" size="30" name="attribute"> <!--Java Script Button to add an additional form field dynamically, with identical form name.--> </fieldset> <!--javascript button to add additional fieldset, with identical structure as above.--> Users can add or remove any number of servers or attributes using the javascript buttons, but the form field names will be the same. When the user presses submit, I will get some number of post variables identified by "attribute", but how can I map them back to a specific server definition? Is this possible? Thanks so much! Hi, I am trying to construct a multipart form-data post request to a web server. However I keep getting malformed multipart post. My set up is Debian Etch/Mozilla 5.0x. I have constructed the multipart post request as follows Code: POST http://192.168.2.5/upload.cgi HTTP/1.1 Accept-Language: en-us Content-Type: multipart/form-data; boundary=---------------------------7d2b119100532 User-Agent: Mozilla/3.01 (compatible) Host: 192.168.2.5 Pragma: no-cache Content-Length: 717 -----------------------------7d2b119100532 Content-Disposition: form-data; name="field1" 5107115015_auto_end -----------------------------7d2b119100532 Content-Disposition: form-data; name="flat_file"; filename="travellerdata.dat" Content-Type: text/plain <SYSSN>5107115015</SYSSN> <HDD slot="0"> <serial>DA40P7C003P5</serial> <model>MAW3300NC</model> <firmware>0104</firmware> </HDD> <network> <adapter slot="1"> <interface slot="1"> <mac>00:E0:81:4B:8F:FD</mac> </interface> </adapter> </network> <BIOS> <revision></revision> <date>06/23/06</date> </BIOS> <CPU_count>4</CPU_count> <CPU slot="0"> <serial>00020F120000000000000000</serial> </CPU> -----------------------------7d2b119100532-- this is the server response that I get Code: Server Response is HTTP/1.1 200 OK Date: Fri, 26 Sep 2008 05:13:55 GMT Server: Apache/2.2.3 (Debian) PHP/5.2.0-8+etch10 Transfer-Encoding: chunked Content-Type: text/html; charset=UTF-8 f3 <h1>Software error:</h1> <pre>Malformed multipart POST </pre> <p> For help, please send mail to the webmaster (<a href="mailto:webmaster@localhost">webmaster@localhost</a>), giving this error message and the time and date of the error. </p> Appreciate if someone can point out where I am going wrong. Thanks, Hi everyone, I would like to know how to put a icon in the identify information. Thanks for your help, tecmeister I am attempting to use google analytics on a website someone else developed. I am now in charge of updating this site but am having a problem finding the home page so I may add a google meta tag which would verify me as site owner. The site is at http://www.vandam.com However when I look at the directory on my ftp site and open the file labeled main.html, it looks nothing like the source code I see via the web. What is going on with this. Which file should I be looking for? Hi, i want some help regarding HTML links. I have a table containing topic and topic id. and another table having topic_id, sequence_no and Replies columns. I have a php + mysql script which show all the topics as html links. Now what i have to do is when any of link is clicked it should get identified and all the corresponding Replies should be displayed sequencially. I dont know how to identify and fetch topic_id on which i have clicked. Please help. Thanks, Jaas. Hi, I am new to this forum. As all other, I have registered because I need help: I am currently working on an automatic news system (if you can call that...), where I write my news story in an .ini file. What I need help with is that I want my page to get the string from the .ini file and "publish" it. If there's an easier/alternative method, please post ~Mikkelet Hi, I am very, very new to XML and I am not able to get my .xsl data file to read into the table in my .xsl file. Thank you, kriscann I cannot get my form to write to my asp file for the life of me. My website is rollingdice.byethost32.com you'll notice a login form with two simple txt fields. I have the action set to the name of the asp file ("logins.asp"). The asp file looks like this Code: <html> <body> <% 'declarations Dim username, password 'initiate declarations username=Request.Form("username") password=Request.Form("password") 'print input Response.Write("Username: " & Request.Form("username") & "<br />") Response.Write("Password: " & Request.Form("password") & "<br />") %> </body> </html> If someone could please tell me what i'm doing wrong it would be much appreciated hi, I had created a form using html.Can i collect all the data tht key in by the user at the form to .txt file? can ths be done by php or html? Can u please guide me step-by-step? Thanks in advance. i want to display wave height data from a noaa buoy that is available and updated via a txt file. how can display this data graphically on a web site instead of just displaying the raw data from the text file? Hello, I have the following data in a text file which then the page reads and displays on a table. ,Event,Member,Time ,3k Run,Tom Heather,9.25 ,3k Run,Alex Peck,9.50 ,3k Run,Leith Sahla,8.20 ,3k Run,Cassie Davis,8.40 ,3k Run,Holly Calender,10.23 ,3k Run,Alex Plunkett,10.45 ,3k Run,Joe Rugg,9.44 ,3k Run,Ben Frere,9.55 ,5k Cycle,Tom Heather,10.45 ,5k Cycle,Louise Peak,11.07 ,5k Cycle,John blackhall,10.22 ,5k Cycle,Frank Kelly,10.56 ,5k Cycle,Sophie Mayo,9.55 ,5k Cycle,Steven Collins,10.37 I have a table which displays this data on my page and then i want to produce a separate table which produces the fastest time for the 3k Run and 5K Cycle events. I figure you have to use the <PARAM NAME="Filter" VALUE="fieldname = value"> but stuck from here really. Some help would be greatly appreciated, Thanks The page code is below <!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-Language" content="en-gb" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Contact Us</title> <style type="text/css"> .style1 { text-decoration: underline; font-family: Arial, Helvetica, sans-serif; } </style> </head> <body> <table style="width: 72%; height: 7px"> <tr> <td> <p class="style1"><strong>Member Competitions </strong></p> </td> </tr> </table> <OBJECT ID = "data" CLASSID = "CLSID:333C7BC4-460F-11D0-BC04-0080C7055A83"> <PARAM NAME = "DataURL" VALUE = "data.txt"> <PARAM NAME = "UseHeader" VALUE = "TRUE"> <PARAM NAME = "FieldDelim" VALUE = ","> </OBJECT> <TABLE DATASRC = "#Data" STYLE = "border-style: ridge; border-color: #666666; background-color: #58595b"> <THEAD><TR STYLE = "background-color: 58595b"> <TH style="width: 164px">Event</TH> <TH style="width: 158px">Member</TH> <TH style="width: 149px">Time</TH> </TR></THEAD> <TBODY> <TR STYLE = "background-color: lightsteelblue"> <TD style="width: 164px"><SPAN DATAFLD = "Event"></SPAN></TD> <TD style="width: 158px"><SPAN DATAFLD = "Member"></SPAN></TD> <TD style="width: 149px"><SPAN DATAFLD = "Time"></SPAN></TD> </TR> </TBODY> </TABLE> <p class="style1"></p> </body> </html> Hello all mates! I am working with my forum trying to properly edit the html for the posts so that they will display any custom script/html of my choice. I want this to appear in ONLY the first post in every thread. I am also trying to find out how to make a bot that automatically posts another second post in every thread, with my own custom scripts/html. At the moment I am trying to add some adsense ads this way. What I am looking for is two things: 1 - How to get the adsense ad aligned to either right or left of the text within the first post. 2 - How to get an adsense bot autopost an ad as post number 2 in any thread (including being applied to all threads already existing) I am using IPB3. I previously used Adsense Bot for IPB2, and that worked fine, but it is not supported for IPB3. It uses the Universal Mod Installer, and in IPB3 there is a new "hook" feature to ass custom mods etc, but I do not know how to alter the code for the Adsense Bot to work with IPB3 so I am trying to get it done from scratch by adding codes directly into the templates. If anyone know how to configure / modify the old Adsense Bot to work with IPB3 that would be great of course, so I am attaching it here just in case someone wants to take a look at it and its documentation and scripts. But primarily I am looking for the two mentioned features, one is how to get the script running in ONLY the first post of every thread - at the moment I got it running, but it is global and implements into all posts not only the first. I also have figured out how to make a script appear, such as an ad, between posts, but not after ONLY the first post, nor how to make a bot that posts a post just like any member, which is what I am really looking for when it comes to that part. This is the code I have entered into the topicViewTemplate in Topic View: Code: {parse template="aip" group="topic" params="$post"} <div style="display:block;float:right;margin: 0px 10px 0px 0px;"> <script type="text/javascript"><!-- google_ad_client = "pub-3737464431076938"; /* forum posts large recnt */ google_ad_slot = "6548059149"; google_ad_width = 336; google_ad_height = 280; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> This works perfectly for adding my desired custom script embedded within the posts. The problem is that it gets embedded in ALL posts and not only the first as I would want. Here is a link to my forum for an example on how it looks: http://www.conspiraciesforums.com/fo...ic/3-atlantis/ I know I have to edit/add some code regarding post counts etc to configure it to only affect the first post - my question is how to do that? And as seen, the second post shows the ad as well, here I would want a bot to post a post containing another ad - between the first and third post of every thread (which will be standard members posts). I have messed my brain with this for more than a week now trying different things, looking around at forums, googling, trying scripts and so on, mods etc, but as of yet have not found the solution to these things for IPB3. Any help here would be extremely greatly appreciated and I'll buy you a beer if you're ever around my part of the world! :p Thanks and bless you! -M Hi Experts, I am designing a webpage where based on the year selection the associated years webtable needs to be displayed in the webpage. Pls give som suggestions and if possible the code on to how to code this using HTML and Jav Script. I know I have to write afunction and then call the fn based on the input.but need your help on this. Thanks, Bsquare I have been using my site for some time now and it carries the image name over when you clicked on purchasing the print. It carries it still, but when you submit the form, the image name isnt there and the form errors because the field is blank. Here is the site: www.sthompsonphoto.com I cant seem to figure out why it disappears when you click Submit? Any help would be great! Hi everybody! I have a jsp page with a form and a table. My aim is that when i press the submit button of the form,collect the data and fill the table with it. I am working with J2EE. I have already collected the data in a Java class,but I dont know how to introduce this data into the table. Best Regards! 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. |