Questions tagged [file-upload]

a method or action of transferring a file from a client to a server.

This tag can be used on questions about uploading files to your web server.

File upload can refer to the sending of data from a local system to a remote system such as a server or another client with the intent that the remote system should store a copy of the data being transferred, or the initiation of such a process.

Resources:

26343 questions
1806
votes
28 answers

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?
Simbian
  • 18,275
  • 3
  • 15
  • 8
1104
votes
15 answers

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?
Surya sasidhar
  • 27,349
  • 55
  • 130
  • 212
842
votes
11 answers

Posting a File and Associated Data to a RESTful WebService preferably as JSON

This is probably going to be a stupid question but I'm having one of those nights. In an application I am developing RESTful API and we want the client to send data as JSON. Part of this application requires the client to upload a file (usually an…
Gregg
  • 31,994
  • 13
  • 93
  • 189
805
votes
25 answers

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: function (data) { alert('success'); …
Willy
  • 9,171
  • 5
  • 24
  • 25
699
votes
14 answers

How to upload files to server using JSP/Servlet?

How can I upload files to server using JSP/Servlet? I tried this:
However, I only get the…
Thang Pham
  • 35,825
  • 73
  • 192
  • 279
601
votes
5 answers

How does HTTP file upload work?

When I submit a simple form like this with a file attached:
Choose a file…
0xSina
  • 18,637
  • 29
  • 125
  • 245
589
votes
13 answers

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 Data to the server? The resulting array ($_POST) on…
zoku
  • 6,336
  • 3
  • 17
  • 24
584
votes
10 answers

HTML Input="file" Accept Attribute File Type (CSV)

I have a file upload object on my page: with the following excel files on my desktop: file1.xlsx file1.xls file.csv I want the file upload to ONLY show .xlsx, .xls, & .csv files. Using the accept attribute,…
Dom
  • 32,648
  • 12
  • 45
  • 77
473
votes
9 answers

Using cURL to upload POST data with files

I would like to use cURL to not only send data parameters in HTTP POST but to also upload files with specific form name. How should I go about doing that ? HTTP Post parameters: userid = 12345 filecomment = This is an image file HTTP File…
thotheolh
  • 6,222
  • 6
  • 27
  • 43
375
votes
7 answers

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

How can I set the value of this?
Alon Gubkin
  • 53,054
  • 52
  • 181
  • 282
300
votes
14 answers

JavaScript file upload size validation

Is there any way to check file size before uploading it using JavaScript?
ArK
  • 18,824
  • 63
  • 101
  • 135
283
votes
12 answers

How to resolve the C:\fakepath?

This is my upload button. This is the text field where I have to show the full path of the file. function theimage(){ var…
e_maxm
  • 2,855
  • 2
  • 13
  • 3
276
votes
12 answers

How to get full path of selected file on change of using javascript, jquery-ajax?

How to get full path of file while selecting file using