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:

28071 questions
2098
votes
30 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
  • 21,203
  • 4
  • 17
  • 8
1169
votes
16 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
  • 29,607
  • 57
  • 139
  • 219
996
votes
11 answers

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

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 image) as well as information about the image. I'm having a hard time tracking down…
Gregg
  • 34,973
  • 19
  • 109
  • 214
855
votes
26 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,681
  • 5
  • 26
  • 25
727
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
  • 20,973
  • 34
  • 136
  • 253
719
votes
14 answers

How can I upload files to a server using JSP/Servlet?

How can I upload files to server using JSP/Servlet? I tried this: However, I only get the…
Thang Pham
  • 38,125
  • 75
  • 201
  • 285
704
votes
12 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
  • 38,906
  • 12
  • 52
  • 81
627
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
  • 7,056
  • 3
  • 20
  • 27
550
votes
11 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
  • 7,040
  • 7
  • 33
  • 49
463
votes
10 answers

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

How can I set the value of this?
Alon Gubkin
  • 56,458
  • 54
  • 195
  • 288
361
votes
15 answers

JavaScript file upload size validation

Is there any way to check file size before uploading it using JavaScript?
ArK
  • 20,698
  • 67
  • 109
  • 136
340
votes
4 answers

REST API - file (ie images) processing - best practices

We are developing server with REST API, which accepts and responses with JSON. The problem is, if you need to upload images from client to server. Note: and also I am talking about a use-case where the entity (user) can have multiple files…
libik
  • 22,239
  • 9
  • 44
  • 87
322
votes
14 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