Search Results

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

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

  • jquey ajax upload file in asp.net mvc

    - by CoffeeCode
    i have a file in my view <form id="upload" enctype="multipart/form-data"> <input type="file" name="fileUpload" id="fileUpload" size="23" /><br /> </form> and an ajax request $.ajax({ url: '<%=Url.Action("JsonSave","Survey") %>', dataType: 'json', processData: false, contentType: "multipart/mixed", data: { Id: selectedRow.Id, Value: 'some date was added by the user here :))' }, cache: false, success: function(data) { } }); but there is no file in the Request.Files. Whats wrong with the ajax request?

    Read the article

  • App-Engine (Java) File Upload

    - by Manjoor
    I managged to upload files on app-engine by using the following example http://stackoverflow.com/questions/1513603/how-to-upload-and-store-an-image-with-google-app-engine-java and http://www.mail-archive.com/[email protected]/msg08090.html The problem is, I am sumitting other fields along with file field as listed below <form action="index.jsp" method="post" enctype="multipart/form-data"> <input name="name" type="text" value=""> <br/> <input name="imageField" type="file" size="30"> <br/> <input name="Submit" type="submit" value="Sumbit"> </form> In my servlet I am getting null when querying name = request.getParameter("name"); Why it is so? Is there a way to retrieve text field value?

    Read the article

  • MVC: Upload image in partial view, routing problem

    - by D.J
    I am trying to upload images via a form which sits in partial view using MVC. View Code: <form action="/Item/ImageUpload" method="post" enctype="multipart/form-data"> <%= Html.TextBox("ItemId",Model.ItemId) %> <input type="file" name="file" id="file" /> <input type="submit" value="Add" /> </form> Action Code: public void ImageUpload(string ItemId, HttpPostedFileBase file) { // upload image // Add Image record to database // Associate Image record to Item record //Go back to existing view where the partial view sits RedirectToAction("Details/"+ItemId); } The Image is uploaded successful All the data manipulation are working as expected However instead of redirect to view "Item/Details/id", page went to "/Item/ImageUpload" I tried several different way of doing this including using jsonResultAction, but all failed in this same result. where did i do wrong, any ideas? thanks in advance

    Read the article

  • File upload using HTML file type.

    - by vaibhav
    I want to upload a file on my aspx page. I am using <form id="frmId" method="post" enctype="Multipart/form-data"> <input type="file" id="file1"/> <input type="submit" id="btnsubmit"/> </form> and in code behind I am trying to get this file. Its not letting me to get the file until I use server side input file control. I don't want to use runat="server" attribute with my file control. Do anyone know how to do this.

    Read the article

  • html post issue

    - by Amarsh
    i have the following html code : <FORM name=frmmail> <input id="dochtmlContent" type="hidden" name="dochtmlContent" value="oldValue"/> <script>document.dochtmlContent="newValue"</script> </FORM> and later on in a javascrip function (which is called upn submit): alert(document.dochtmlContent); document.frmmail.method = "post"; document.frmmail.ENCTYPE = "application/x-www-form-urlencoded"; document.frmmail.action = "/myServlet"; document.frmmail.submit(); Basically, I am declaring a hiden variable, changing its value and submitting it. The issue is, while I see an alert box displaying "newValue", when I submit it, my servlet recieves the "oldValue" for the dochtmlContent parameter. Can someone suggest whats wrong here.

    Read the article

  • Need to get the uploaded file to my local PC

    - by Suhail
    Hi, I have created a test form which will ask users to enter a name and upload the image file: <html lang="en"> <head> <title>Testing image upload</title> </head> <body> <form action="/services/upload" method="POST" enctype="multipart/form-data"> File Description: <input name='fdesc' type='text'><br> File name: <input type="file" name="fname"><br> <div><input type="submit"></div> </form> </body> </html> i need to get the file uploaded by the user and store it on my local PC. can this be done in python ? please let me know.

    Read the article

  • I want to design a html form in python

    - by VaIbHaV-JaIn
    when user will enter details in the text box on the html from <h1>Please enter new password</h1> <form method="POST" enctype="application/json action="uid"> Password<input name="passwd"type="password" /><br> Retype Password<input name="repasswd" type="password" /><br> <input type="Submit" /> </form> </body> i want to post the data in json format through http post request and also i want to set content-type = application/json

    Read the article

  • Client validation of INPUT of type FILE without postback using jQuery

    - by Fixer
    I want to check on the client side that a file has been selected before the form can be submitted. <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script> @using (Html.BeginForm("Upload", "Files", FormMethod.Post, new { enctype = "multipart/form-data" })) { <input id="File" name="File" type="file" size="80" /> <input type="submit" name="name" value="Upload" /> } Currently this form is doing postbacks for validation. What is going wrong?

    Read the article

  • How to get the path of a file before its uploaded?

    - by user172247
    I have an upload box... < form action="upload_file.php" method="post" enctype="multipart/form-data"><BR> < label for="file">Filename:</label><BR> < input type="file" name="file" id="file" /><BR> < input type="submit" name="submit" value="Submit" /> < /form> Now when I click browse and get the Image I want to upload and click it, it shows the path of the file into the text box that comes with. Now I want to get that path and insert it into a < img > tag so It will show to get a preview before I upload.

    Read the article

  • JSP doPost getAtribute null value

    - by newbie123
    I want to pass value to servlet but I keep get null value. <jsp:useBean id="Helper" class="model.Registration" scope="request"/> <form action="/Project/Registration" method="post" enctype="multipart/form-data"> <input type="text" size="20" name="name" value="<%=Helper.getName()%>"> <input type="submit"> </form> protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Registrationh2 = (Registration) request.getAttribute("Helper"); if(h2!=null){ System. out.println(h2.getName()); } else System. out.println("NULL"); } Is there anything wrong with my code?

    Read the article

  • uploading different types of files mostly pdfs

    - by Anders Kitson
    I would like to upload different types of files pressumably pdfs to a certain directory I am currently trying to get this one script working that I found on snipplr but it is not working as I assumed it would, here is my code. <?php if( isset($_POST['submit']) ) { $target_path = "../downloads/"; $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!"; } } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" enctype="multipart/form-data"> <input type="file"> <input type="submit" name="submit" value="submit" /> </form>

    Read the article

  • PHP: variable not working inside of function?

    - by mathiregister
    hi guys, echo $path; //working function createList($retval) { echo $path; //not working print "<form method='POST' action='' enctype='multipart/form-data'>"; foreach ($retval as $value) { print "<input type='checkbox' name='deletefiles[]' id='$value' value='$value'>$value<br>"; } print "<input class='submit' name='deleteBtn' type='submit' value='Datei(en) löschen'>"; print "</form>"; } what am I doing wrong? why is $path printed corretly outside of the createlist function, but it's not inside of the function?

    Read the article

  • JavaScript: Text "submit" link?

    - by Tedd
    I have the the following code and want to use a hyper link to submit my form. <form name="form_signup" id="form_signup" method="post" action="/" enctype="multipart/form-data"> ... <input type="submit" value="Go to Step 2" name="completed" /> or <a onclick="javascript:this.form.submit();">Proceed without uploading</a></span> </form> However, my hyperlink submit doesn't work. It just keeps me on the same page. Question: any idea why my link submit text doesn't work?

    Read the article

  • Is posible to submit multipart/form-data without refresh page in jQuery?

    - by bugbug
    I want to upload picture from "my_form" in jQuery, I tried submit() function it alway redirect to SavePicture.jsp. Is posible to sumbit this form without refresh any page? This is my html code <form action="SavePicture.jsp" method="post" id="my_form" enctype="multipart/form-data"> <input name="file" type="file" id="file" size="35"> <input type="button" onClick="upload()" value="upload"></input> </form> And my script function upload{ jQuery("form#my_form").submit(); }

    Read the article

  • Why wont this simple code work all of a sudden?

    - by eric
    Why wont this print "success" when i submit the form?!?! Im pretty sure it should work. <?php if (count($_POST) > 0) { echo "success!!"; } ?> <form method="post" enctype="multipart/form-data"> <input type="file" name="userfile" /> <input type="submit" value="upload" /> </form>

    Read the article

  • Ajax image upload and javascript edit on the fly with ASP.NET MVC (without saving to disk)

    - by gavss
    1) Uploadimage action gets requests from form posts. <form action="/content/uploadimage" method="post" enctype="multipart/form-data"> It reads HttpPostedFileBase stream data and sends it to the response. I need to show the image in a div container instead of sending it to the response as a file so that users can manipulate the image using jcrop. Image source is generated at runtime. I can't pass an action name to the src attribute. Is this possible using MVC and without using control viewstate? 2) I don't want to use flash or silverlight. Is there an easy ajax alternative to the method I use to get files from user?

    Read the article

  • i get error when i try to upload a file?

    - by getaway
    I keep getting an error:Notice: Undefined index: on line 35 line 35: $handle = new Upload($_FILES['my_field']); this is my input field <input type="file" size="32" name="my_field" value="" /> I do not understand this error, thanks!!! EDIT: <form name="upload" id="upload" enctype="multipart/form-data" method="post" action="actions/upload.php" /> <p><input type="file" size="32" name="my_field" value="" /></p> <p class="button"><input type="hidden" name="action" value="image" /> <br> <input style="margin-left:224px;" type="submit" name="submit" value="upload" />

    Read the article

  • $_FILES empty on image upload

    - by zvir
    i need help, i'm programing some kind of catalogue and i have a page where clients can upload their logo or images. every page i make is included in index.php and my url looks like something like this www.url.com/index.php?s=upload where "upload" is name of upload.php file. when i create form on that upload.php file and submit it, $_FILES array is empty. echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"index.php\" />\n"; echo "<input type=\"file\" name=\"image\">\n"; echo "<input type=\"hidden\" name=\"s\" value=\"upload\">\n"; echo "<input type=\"submit\" name=\"submit\" value=\"Spremi\">\n"; echo "</form>\n"; i tried everything and nothing works. $_POST items are returned but $_FILES are empty...

    Read the article

  • Upload files, form within form

    - by Alexd2
    Hello everyone and thanks in advance. I have a problem and I have 2 form into one another, the domestic form is to perform a file upload. As I can do to make when sending in internal form not run the main form. <form name="x" method="post" action="xxx.php"> .... <form action="" method="post" enctype="multipart/form-data" target="xxx"> <input type="file" /> <input type="submit" /> </form> <iframe id="xxx" src="process.php"> </iframe> .... <input type="submit" name="pro" value="Register user"/ > </form> Doing this does not work, as this within another form. Any help or possible solution.

    Read the article

  • how do I get the form data in a javascript object so I can send it as the data parameter of an $.aja

    - by user281180
    How to return json after form.submit()? <form id="NotificationForm" action="<%=Url.Action("Edit",new{Action="Edit"}) %>" method="post" enctype="multipart/form-data" onsubmit='getJsonRequestAfterSubmittingForm(this); return false;'> <%Html.RenderPartial("IndexDetails", Model);%> </form> $.ajax({ url: '<%=Url.Action("Edit","Notification") %>', type: "POST", dataType: 'json', data: $("#NotificationForm").submit(), contentType: "application/json; charset=utf-8", success: function(result) { if (result.Result == true) { alert("ghjghsgd"); } }, error: function(request, status, error) { $("#NotSelectedList").html("Error: " & request.responseText); } });

    Read the article

  • encode data in get request

    - by user902395
    <!DOCTYPE html> <html> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <body onload="searchForPrograms.submit();"> <form id="searchForPrograms" name="searchForPrograms" enctype="application/x-www-form-urlencoded" method="get" action="searchingEngine.php"> <input type="text" id="query" name="query" value="MyProgram" /><br> <input type="submit" value="Search" /> </form> </body> The get request should have the form like "searchingEngine.php?query=%22MyProgram%22". How can I encode the value of the query input correctly?

    Read the article

  • Unable to recieve file contents on server during upload

    - by Khushal
    Hello, I have a JSP page in which I have a file input field from which I browse a csv file and then upload it on server. I am using method = "POST" and ENCTYPE='multipart/form-data' in the form in which this file input field is present. On the servlet side(in the application's servlet) I am making use of apache's commom file upload API-ServletFileUpload API. After getting the FileItem list from the method parseRequest(request) of this API I am unable to get the file name and its content by using the methods getName(), getString() of FileItem API. Needed to know what am I doing wrong or any modifications in my approach that will make my application to work. Any pointers regarding this will be helpful. Thanks in advance!!

    Read the article

  • I can't upload a file with CGIHTTPServer

    - by sdemingo
    Hi all, I'm using the CGIHTTPServer to implement a simple cgi server. I'm trying to upload a file by a form with the post method and the multipart/form-data enctype but I have problems when I recover the value of the fields in the cgi script. When the script catch the form fields, the value of the file is a MiniFieldStorage with two fields only (key and file name), and I can't recover the content of the file. As the API doc shows, this content is in value field of a StorageField but in the MiniFieldStorage this field isn't exits. ¿How can I recover a StorageField with the content of the file instead a MiniStorageField? ¿There are other method to upload a file using CGIHTTPServer? Thanks a lot

    Read the article

  • How to Upload a file from client to server using OFBIZ?

    - by SIVAKUMAR.J
    Hi all, Im new to ofbiz.So is my question is have any mistake forgive me for my mistakes.Im new to ofbiz so i did not know some terminologies in ofbiz.Sometimes my question is not clear because of lack of knowledge in ofbiz.So try to understand my question and give me a good solution with respect to my level.Because some solutions are in very high level cannot able to understand for me.So please give the solution with good examples. My problem is i created a project inside the ofbiz/hot-deploy folder namely "productionmgntSystem".Inside the folder "ofbiz\hot-deploy\productionmgntSystem\webapp\productionmgntSystem" i created a .ftl file namely "app_details_1.ftl" .The following are the coding of this file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script TYPE="TEXT/JAVASCRIPT" language=""JAVASCRIPT"> function uploadFile() { //alert("Before calling upload.jsp"); window.location='<@ofbizUrl>testing_service1</@ofbizUrl>' } </script> </head> <!-- <form action="<@ofbizUrl>testing_service1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> --> <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> <center style="height: 299px; "> <table border="0" style="height: 177px; width: 788px"> <tr style="height: 115px; "> <td style="width: 103px; "> <td style="width: 413px; "><h1>APPLICATION DETAILS</h1> <td style="width: 55px; "> </tr> <tr> <td style="width: 125px; ">Application name : </td> <td> <input name="app_name_txt" id="txt_1" value=" " /> </td> </tr> <tr> <td style="width: 125px; ">Excell sheet &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </td> <td> <input type="file" name="filename"/> </td> </tr> <tr> <td> <!-- <input type="button" name="logout1_cmd" value="Logout" onclick="logout1()"/> --> <input type="submit" name="logout_cmd" value="logout"/> </td> <td> <!-- <input type="submit" name="upload_cmd" value="Submit" /> --> <input type="button" name="upload1_cmd" value="Upload" onclick="uploadFile()"/> </td> </tr> </table> </center> </form> </html> the following coding is present in the file "ofbiz\hot-deploy\productionmgntSystem\webapp\productionmgntSystem\WEB-INF\controller.xml" ...... ....... ........ <request-map uri="testing_service1"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.productionmgntSystem.web_app_req.WebServices1" invoke="testingService"/> <response name="ok" type="view" value="ok_view"/> <response name="exception" type="view" value="exception_view"/> </request-map> .......... ............ .......... <view-map name="ok_view" type="ftl" page="ok_view.ftl"/> <view-map name="exception_view" type="ftl" page="exception_view.ftl"/> ................ ............. ............. The following are the coding present in the file "ofbiz\hot-deploy\productionmgntSystem\src\org\ofbiz\productionmgntSystem\web_app_req\WebServices1.java" package org.ofbiz.productionmgntSystem.web_app_req; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.DataInputStream; import java.io.FileOutputStream; import java.io.IOException; public class WebServices1 { public static String testingService(HttpServletRequest request, HttpServletResponse response) { //int i=0; String result="ok"; System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- Start"); String contentType=request.getContentType(); System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- contentType : "+contentType); String str=new String(); // response.setContentType("text/html"); //PrintWriter writer; if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) { System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) after if (contentType != null)"); try { // writer=response.getWriter(); System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - try Start"); DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; //this loop converting the uploaded file into byte code while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead,formDataLength); totalBytesRead += byteRead; } String file = new String(dataBytes); //for saving the file name String saveFile = file.substring(file.indexOf("filename=\"") + 10); saveFile = saveFile.substring(0, saveFile.indexOf("\n")); saveFile = saveFile.substring(saveFile.lastIndexOf("\\")+ 1,saveFile.indexOf("\"")); int lastIndex = contentType.lastIndexOf("="); String boundary = contentType.substring(lastIndex + 1,contentType.length()); int pos; //extracting the index of file pos = file.indexOf("filename=\""); pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; int boundaryLocation = file.indexOf(boundary, pos) - 4; int startPos = ((file.substring(0, pos)).getBytes()).length; int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length; //creating a new file with the same name and writing the content in new file FileOutputStream fileOut = new FileOutputStream("/"+saveFile); fileOut.write(dataBytes, startPos, (endPos - startPos)); fileOut.flush(); fileOut.close(); System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - try End"); } catch(IOException ioe) { System.out.println("\n\n\t*********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - Catch IOException"); //ioe.printStackTrace(); return("exception"); } catch(Exception ex) { System.out.println("\n\n\t*********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - Catch Exception"); return("exception"); } } else { System.out.println("\n\n\t********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) else part"); result="exception"; } System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- End"); return(result); } } I want to upload a file to the server.The file is get from user "<input type="file"..> tag in the "app_details_1.ftl" file & it is updated into the server by using the method "testingService(HttpServletRequest request, HttpServletResponse response)" in the class "WebServices1".But the file is not uploaded. Give me a good solution for uploading a file to the server. Thanks & Regards, Sivakumar.J

    Read the article

  • How can I do a large file upload using Sinatra, haml, nginx, and passenger?

    - by mmr
    Hi all, I need to be able to allow a user to upload 30-60 mb files at a time. Right now, I'm solving the problem with a simple form post: %form{:action=>"/Upload",:method=>"post",:enctype=>"multipart/form-data"} - @theModelHash.each do |key,value| %br %input{:type=>"checkbox", :name=>"#{key}", :value=>1, :checked=>value} =key %br %input{:type=>"file",:name=>"file"} %input{:type=>"submit",:value=>"Upload"} This form allows the user to select processing options contained in theModelHash and upload a file for processing. Problem is, this method both freezes the user's UI and also requires that the entire form be reposted when the user presses the 'back' button. I've looked at SWFUpload, but have no idea how to integrate that into my relatively simple app. There's a page here about integrating it with Rails, but I'm using Sinatra, and am new enough to this whole web programming thing that I don't know how to modify those files to work with what I need to do. Is there a how-to to add large file uploads to my form there? Something relatively simple that just adds in a progress bar and doesn't repost? I feel like I'm having to triple the size of my application just to make this feature play nice, and that's bothering me a bit.

    Read the article

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