All Questions

575
votes
12answers
427871 views

How to upload files to server using JSP/Servlet?

How can I upload files to server using JSP/Servlet? I tried this: <form action="upload" method="post"> <input type="text" name="description" /> <input type="file" name="file" /...
553
votes
20answers
972521 views

jQuery Ajax File Upload

Can I use the following jQuery code to perform file upload using post method of an Ajax request ? $.ajax({ type: "POST", timeout: 50000, url: url, data: dataString, success: funct...
440
votes
10answers
660627 views

Sending multipart/formdata with jQuery.ajax

I've got a problem sending a file to a serverside PHP-script using jQuery's ajax-function. It's possible to get the File-List with $('#fileinput').attr('files') but how is it possible to send this Dat...
1038
votes
20answers
655316 views

Preview an image before it is uploaded

I want to be able to preview a file (image) before it is uploaded. The preview action should be executed all in the browser without using Ajax to upload the image. How can I do this?
99
votes
2answers
98372 views

Recommended way to save uploaded files in a servlet application

I read here that one should not save the file in the server anyway as it is not portable, transactional and requires external parameters. However, given that I need a tmp solution for tomcat (7) and t...
83
votes
8answers
116844 views

How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable

I'm trying to upload a file using PrimeFaces, but the fileUploadListener method isn't being invoked after the upload finishes. Here is the view: <h:form> <p:fileUpload fileUploadListene...
139
votes
9answers
417016 views

How to get full path of selected file on change of <input type=‘file’> using javascript, jquery-ajax?

How to get full path of file while selecting file using <input type=‘file’> <input type="file" id="fileUpload"> <script type="text/javascript"> function getFilePath(){ $('i...
213
votes
5answers
363548 views

How to set a value to a file input in HTML?

Note: The answers & comments below reflect the state of legacy browsers in 2009. Now you can actually set the value of the file input element dynamically/programatically using JavaScript a...
260
votes
26answers
607909 views

File Upload using AngularJS

Here is my HTML form: <form name="myForm" ng-submit=""> <input ng-model='file' type="file"/> <input type="submit" value='Submit'/> </form> I want to upload an image ...
796
votes
14answers
516561 views

Maximum request length exceeded.

I am getting the error Maximum request length exceeded when I am trying to upload a video in my site. How do I fix this?

Previous Next