Search Results

Search found 208 results on 9 pages for 'enctype'.

Page 1/9 | 1 2 3 4 5 6 7 8 9  | Next Page >

  • PHP uploads file - enctype="multipart/form-data" issue

    - by user147685
    Hi all, I have this upload code. there are no problem running it individually, but when i try to add into my other codes, it did not get the $_files parameter. Im guessing it was becoz of enctype="multipart/form-data" in the form tag, based on this post: http://stackoverflow.com/questions/1695246/why-file-upload-didnt-work-without-enctype the enctype is needed. SO my problem is, how can i do upload files without concern to this? can we juz change the code structure so that it will be compatible with other codes? if($_POST['check']){ $faillampiran=$_POST['faillampiran']; $file=$_FILES['faillampiran']["name"]; $fileSize = $_FILES['faillampiran']['size']; $fileType = $_FILES['faillampiran']['type']; if ($_FILES["faillampiran"]["error"] > 0 ) { echo "Return Code: " . $_FILES["faillampiran"]["error"] . "<br />"; } else { move_uploaded_file($_FILES["faillampiran"]["tmp_name"],"upload/" . $_FILES["faillampiran"]["name"]); echo '<table align = "center">'; echo "<tr><td>"; echo "Your file has been successfully stored."; echo "</td></tr>"; echo '</table>'; } } ?> <form method="post" name="form1" id="form1" enctype="multipart/form-data"> <tr><td></td><td><input type="hidden" name="MAX_FILE_SIZE" value=""> </td> </tr> <tr><td> Please choose a file</td><td>:</td></tr> <tr> <input type="file" size="50" name="faillampiran" alt="faillampiran" id="faillampiran" 1value= "<?=$faillampiran;?>" /> <tr align = "center"><td colspan = "3"><input type="submit" value="Hantar" name="check"/></td></tr> </tr></form> thank you.

    Read the article

  • Does form with enctype="multipart/form-data" cause problems accessing a hidden field

    - by Ankur
    I have created a hidden form element <form name="UploadImage" enctype="multipart/form-data" method="post" action="UploadImage"> <label> </label> <input name="imgUploadObjId" id="imgUploadObjId" value="52" type="hidden"> //rest of the form here </form> And I am trying to get the value with this line in a servlet (as I have done before): int objId = Integer.parseInt(request.getParameter("imgUploadObjId")); But I get this (line 33 is the line above): java.lang.NumberFormatException: null java.lang.Integer.parseInt(Unknown Source) java.lang.Integer.parseInt(Unknown Source) web.objects.UploadImage.doPost(UploadImage.java:33) javax.servlet.http.HttpServlet.service(HttpServlet.java:637) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) Is there something different about a form with enctype="multipart/form-data"? Or can you see some other error.

    Read the article

  • remove enctype=multipart from the asp.net form(Sharepoint)

    - by ps123
    I have a form that I want to postback to some other server on button click . I am using onpostbackurl ...Its posting the form to other server but text field input is not getting into other server. If I remove enctype="multipart.. it seems to be working fine...but the thing is I am doing all this in sharepoint and <formid="aspnetform" enctype="multipart/datapart"...is getting added on its own..... in my control I am giving text field and button only .....Any idea how to achieve this...?

    Read the article

  • Page doesn't post to the given URL

    - by Sri Kumar
    Hello All, I have the following HTML content. When i click the button, the page doesn't post to URL provided in action tag. The corresponding application is running, but still the page load of the CrossPage.aspx was not invoked. What could be the problem? <body> <form id="UploadForm" method="post" enctype="multipart/form-data" action="http://localhost:2518/Web/CrossPage.aspx"> <div> <input type="file" id="BtnUpload" /> <input type="button" id="BtnSubmit" value="Submit" /> </div> </form> </body>

    Read the article

  • Firefox Upload Form Issue

    - by cast01
    Ive created an uplaod script in php that takes a file, resizes it, and creates a cropped square thumbnail. The script itself seems to work fine. However, when i tried to upload an image through firefox, on clicking the submit button the browser shows the loading animation, but it never calls the script, it just stays on the current page. If dont upload an image, then the script can be found and is run. I tried in safari, and i dont get the same problem, i can upload an image from the form, it will process it and take me the correct page. Ive tired just calling a basic script from the form, it just prints out the $_POST and $_FILES, and i get the same result, if an image is present, it wont get to the script, if no image is present, it runs fine. Im just wondering if anyone has any idea whats going on?

    Read the article

  • ASP.NET MVC Ajax Form: Is enctype correct? Why doesn't file get uploaded?

    - by Fabio Milheiro
    In the case that the user doesn't have Javascript activated, in order to draw a form, I begin this way: <% using (Html.BeginForm("Create", "Language", FormMethod.Post, new {enctype="multipart/form-data"})) { %> If the user has Javascript activated, the following code is used: <% using (Ajax.BeginForm("Create", "Language", new AjaxOptions { UpdateTargetId = "CommonArea" }, new { enctype = "multipart/form-data" })) { %> The problem is this: In the first case, I can get the file uploaded using the following instruction in the business layer: // Get the uploaded file HttpPostedFile Flag = HttpContext.Current.Request.Files["Flag"]; In the second case, this instruction doesn't work. How do I know upload that file using the Ajax.BeginForm? Is the code right? Can anyone more experience advise about using jQuery plug-in to upload file before the form submission? Thank you

    Read the article

  • BeginForm in RC bug?

    - by msony
    I think that there are something wrong with new RC, when i write Html.BeginForm("Item", "Newsletter", FormMethod.Post, new { enctype = "multipart/form-data" }) method must render in output something like this: <form action="/Newsletter/Item" enctype = "multipart/form-data" method="POST"></form> but instead of that im getting: <form action="Item" enctype = "multipart/form-data" method="POST"></form> where my full action path?

    Read the article

  • DotNetNuke + PayPal

    - by Nuri Halperin
    A DotNetNuke i'm supporting has had a paypal "buy now" button and other variations with custom fields for a while now. About 2 weeks ago (somewhere in March 2010) they all stopped working. The problem manifested such that once you clicked the "buy now" button, Paypal site would throw a scary error page to the effect of: "Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information about this error may be available in the server error log" Once I verified no cheeky content editor changed the page, I went digging for answers. The main source incompatibility of PayPal's simple HTML forms is that DNN includes a form on every page, and nested forms are not really supported. As blogged here and lamented here, the solution I came up with is simply to modify the form enctype to 'application/x-www-form-urlencoded' as illustrated below: 1: <input type="image" border="0" 2: src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" 3: name="submit" 4: alt="PayPal - The safer, easier way to pay online!" 5: onClick="this.form.action='https://www.paypal.com/cgi-bin/webscr'; this.form.enctype='application/x-www-form-urlencoded';this.form.submit();" /> One would think that PayPal would want the masses submitting HTML in all manners of "enctype", but I guess every company has it's quirks. At least my favorite non-profit can now continue and accept payments. Sigh.

    Read the article

  • JQuery and form attributes change in IE

    - by bounce
    Hi, I want to change form attributes with JQuery. In other browsers it works fine, but not in IE(6,7,8). Code: action = '/controller/action/id/'; target = 'upload_iframe'; enctype = 'multipart/form-data'; $('#form1').attr("action",action); $('#form1').attr("target",target); $('#form1').attr("enctype",enctype); So what's the problem ? Your help would be appreciated.

    Read the article

  • How combine 2 functions on submit?

    - by Mahmoud
    hey there, as you can see, i have to functions first to check if all forms are not empty and the second function is to verify the captcher, when i combine them together both work at the same time, i want to first to verify the first function, when that function returns true then the other function starts, here is the code that i used on form <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" Checking(this); return jcap();" > As you can see both function execute at the same time so i tried this <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" if(Checking(this) == true ){ return jcap();}" > is bypass both i also tried this <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" return(Checking(this) && jcap(this));" > and it bypassed jcap function

    Read the article

  • Problem uploading .docx through html form

    - by Mikael
    I've made a simple form, with the proper enctype for uploading files. When i try to upload a .docx everything works fine in IE 8 and Safari, but in Firefox or IE 7 or 6 i can't even click submit, nothing happens! Could this still be a server issue? It's an apache server. Everything works fine if i choose to upload a .doc file <form enctype="multipart/form-data" method="post" action="index.php"> <input name="file" type="file" /> <input type="submit" name="btnSubmit" value="Submit"/> </form>

    Read the article

  • Edit and Create view using EditCreate.ascx partial in ASP.NET MVC

    - by mare
    If you look at the NerdDinner example of creating and editing dinners then you see they use a partial (ViewUserControl or ASCX) DinnerForm to put the functionality of creating and editing dinners into one file because it is essential the same and they use it using RenderPartial("DinnerForm"). This approach seems fine for me but I've run into a problem where you have to add additonal route values or html properties to the Form tag. This picks up the current action and controller automatically: <% using (Html.BeginForm()) { %> However, if I use another BeginForm() overload which allows to pass in enctype or any other attribute I have to do it like this: <% using ("Create", "Section", new { modal = true }, FormMethod.Post, new { enctype = "multipart/form-data" })) and as you can see we lose the ability to automatically detect in which View we are calling RenderPartial("OurCreateEditFormPartial"). We can't have hardcoded values in there because in Edit View this postback will fail or won't postback to the right controller action. What should I do in this case?

    Read the article

  • [js] how combine to functions on submit?

    - by Mahmoud
    hey there, as you can see, i have to functions first to check if all forms are not empty and the second function is to verify the captcher, when i combine them together both work at the same time, i want to first to verify the first function, when that function returns true then the other function starts, here is the code that i used on form <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" Checking(this); return jcap();" > As you can see both function execute at the same time so i tried this <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" if(Checking(this) == true ){ return jcap();}" > is bypass both

    Read the article

  • Drupal 6 hook_form_FORM_ID_alter adding upload file field

    - by kristian nissen
    I'm trying to extend a form and add an upload file field from within a module, I can see the file field just fine, but it's empty when I submit the form, the enctype is set. $form['#attributes'] = array( 'enctype' => "multipart/form-data" ); $form['file_upload'] = array( '#type' => 'file', '#title' => 'Attach Image' ); custom form submit hook: $form['#submit'][] = 'user_images_handler'; is being called, but when I dump the form, the file field is empty, and when I try to access it, it's empty as well.

    Read the article

  • [js] how combine 2 functions on submit?

    - by Mahmoud
    hey there, as you can see, i have to functions first to check if all forms are not empty and the second function is to verify the captcher, when i combine them together both work at the same time, i want to first to verify the first function, when that function returns true then the other function starts, here is the code that i used on form <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" Checking(this); return jcap();" > As you can see both function execute at the same time so i tried this <form action="reg.php" method="post" enctype="application/x-www-form-urlencoded" onsubmit=" if(Checking(this) == true ){ return jcap();}" > is bypass both

    Read the article

  • Upload file in Android webview

    - by Sunny
    I have a html form like this <form data-ajax="false" action='UserPhoto.php' class="settings" method='POST' enctype='multipart/form-data' > <input type='file' style="height:25px" name='photo' /> <input type='hidden' name='task' value='upload'> <input type='hidden' name='file_size' value='5000000'> and I want to upload it by using webView posturl function, is it possible? as I know posturl can send String data by this way String value1 = "persistent=1"; String value2 = "&email="+ 2nd_value; String value3 = "&password="+ 3rd_value; String postData = value1+value2+value3; webView.postUrl("http://www.abc.php",EncodingUtils.getBytes(postData, "BASE64")); but is it possible for me to post .png together with some string values? and I know another method using this way to upload photo conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("ENCTYPE", "multipart/form-data"); conn.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary); conn.setRequestProperty("photo", fileName); but this way doesn't communicate with webview, I need to post the photo using webview as user session is kept with it. Thanks for helping.

    Read the article

  • Submit Form Equivalent To WML

    - by Nathan Campos
    I'm playing a little bit with WML with PHP, then I want to know what is the equivalent of this on WML: <form action="upload_file.php" method="post"enctype="multipart/form-data"> <label for="file">File:</label><br /> <input type="file" name="file" id="file" /><br /> <input type="submit" name="submit" value="Submit" /> </form>

    Read the article

  • blobstore upload code not working

    - by Bunny Rabbit
    <body> <form action="<%= blobstoreService.createUploadUrl("/upload") %>" method="post" enctype="multipart/form-data"> <input type="file" name="myFile"> <input type="submit" value="Submit"> </form> </body> the above code throws a java.lang.NoSuchMethodError on compilation.I can't understand and what is blobstoreService in the above code ?

    Read the article

  • form name in mvc url.action

    - by user281180
    I am having the following <form action="<%=Url.Action("PasswordDetails",new{Controller = "User"}) %>" method="post" name="PasswordForm" id="PasswordForm" enctype="multipart/form-data"> However, the $("#PasswordForm").submit(function() { if (validate()) return true; else return false; }); isn`t being passed through. What is wrong?

    Read the article

  • File upload in asp.net mvc using ajax

    - by Maxim
    Hello! i have a simple html form with two controls: input-text and input-file i need to write an ajax query (using jquery is better) to send data (file and value from text field to mvc acton) i wrote $.ajax({ type: "POST", url: "/controller/acton", enctype: 'multipart/form-data', data: 'text=' + $("#text").val() + '&file=' + $("#file").val() ... and in controller: [HttpPost] public ActionResult StoreItem(FormCollection forms) { foreach (string inputTagName in Request.Files) ... returns null in Request... Thank you

    Read the article

  • A browser half way between Lynx and modern browsers.

    - by Majid
    Hi, I am looking for a simplistic browser with and without the following capabilities: No Javascript / Java / Flash No Image rendering (and ignoring image-related CSS) Supporting CSS Supporting cookies Supporting forms, anchors, and other HTML elements Supporting GET / POST, and POST with enctype="multipart/form-data" In fact I am looking for a GUI Lynx or something similar. Do you know anything resembling this? Thanks.

    Read the article

  • ASP.NET MVC: when posted Upload File, it is null in action method

    - by Spencer
    In the View page, code is below: <% =Html.BeginForm("About", "Home", FormMethod.Post, new {enctype="multipart/form-data "})%> <input type ="file" name ="postedFile" /> <input type ="submit" name ="upload" value ="Upload" /> <% Html.EndForm(); %> In the Controller, something like this: [AcceptVerbs(HttpVerbs.Post)] public ActionResult About(HttpPostedFile postedFile) { //but postedFile is null View(); } But postedFile is null, how to do it?

    Read the article

1 2 3 4 5 6 7 8 9  | Next Page >