Questions tagged [input-type-file]

HTML input control for uploading files ``

A form in an HTML document (Web page) can contain an input element with type="file". This may let the user include one or more files into the form submission. The form is often processed so that such files are stored onto the disk of the Web server; this is why file input (or file submission) is often called “file upload.”

Syntax: <input type="file" />
172 questions
595
votes
26 answers

Twitter Bootstrap Form File Element Upload Button

Why isn't there a fancy file element upload button for twitter bootstrap? It would be sweet if the blue primary button was implemented for the upload button. Is it even possible to finesse the upload button using CSS? (seems like a native browser…
somejkuser
  • 8,273
  • 18
  • 51
  • 111
193
votes
20 answers

How can I clear an HTML file input with JavaScript?

I want to clear the file input in my form. I know about setting the sources to the same method... But that method wont erase the selected file path. Note: I would like to avoid having to reload the page, reset the form or perform an AJAX call. Is…
user188962
102
votes
4 answers

limit selectable files by extensions

How can someone limit the files that can be selected with the input type="file" element by extensions? I already know the accept attribute, but in chrome it does limit the files by the last MIME Type defined (in this case "gif") and FF4 does not…
haemse
  • 3,079
  • 4
  • 25
  • 38
22
votes
4 answers

Chrome mobile browser memory error when upload file

Hi, Is it possible to create a custom file upload to prevent chrome's unable to complete previous operation due to low memory error"? It works perfectly on the desktop version of chrome. Actually I use an input type="file" control and I got this…
L.Grillo
  • 841
  • 3
  • 12
  • 25
21
votes
3 answers

How to display a image selected from input type = file in reactJS

I'm trying to display a image selected from my computer in my web app. I referred the following question which addresses the question i'm trying to fix. How to display selected image without sending data to server? I have my html part like this …
CraZyDroiD
  • 5,264
  • 21
  • 64
  • 138
14
votes
4 answers

How to style Ionic input type file as a Button

I want to style a ionic file chooser button. But Ionic don't have an Input type file button. So how can I get a better looking button than the standard Button with a Choose a File text ?
Erdem Güngör
  • 837
  • 5
  • 13
  • 26
11
votes
5 answers

Browse button with input group is cropping on IE9

Using bootstrap, I created input-group with a button and input type='file'. It is working fine everywhere except IE9. On IE9 the browse button is being cropped from right side. Demo: http://jsbin.com/alESiBo/6/edit Code:
Zain Shaikh
  • 5,833
  • 6
  • 35
  • 64
10
votes
1 answer

Any possible way to handle an action between WKWebView and Browser for selecting an image in iOS?

I want to upload a static image on select of button (as described in below screenshot) on the web url from my app using WKWebView. On click of Choose File button it will open default action sheet of device and after the…
ios_dev
  • 957
  • 13
  • 26
10
votes
1 answer

How to convert the file/s upload request made through Filepicker into the similar request made by using simple HTML File control/s in PHP?

I've simple HTML File control/s on my form. It's dynamic in nature, means user can upload one or multiple files. Its HTML is as follows : If I…
PHPLover
  • 7,021
  • 32
  • 90
  • 182
8
votes
4 answers

Angular js Input type file - clear previously selected file

I am using input type="file" for my upload control using angular js. Everytime I click on browse, I do not want to see the previously selected file. By default,this seems to be retained. Can it be achieved by writing a directive? Can it be triggered…
8
votes
3 answers

How to check an input type="file" has a file or not using jquery?

I have a file upload control in my page... How to check an input type="file" has a file or not using jquery on click of a button upload?
ACP
  • 32,884
  • 96
  • 217
  • 360
6
votes
2 answers

How to change the format of input type datetime-local?

I am giving an input field with type datetime-local, In which after filling and viewing it, the format is like this, 2017-08-06T02:32 . It looks like awkward and i need this…
Maniraj Murugan
  • 6,412
  • 10
  • 56
  • 92
6
votes
2 answers

How to unit-test a method that receives a FormCollection to upload a file?

I want to Unit-test a method like the following: public ActionResult StoreFile(FormCollection form, string _paginaAtual) { Session["MySession"] = 1 if (Request.Files["uploadedFiles"] != null) { //do something about…
Lynx Kepler
  • 662
  • 1
  • 9
  • 21
5
votes
1 answer

how to hide file location in ?

Possible Duplicate: How to hide text field in Html File Upload I'm setting up an AJAX image uploader that will allow a user to choose a file, preview it with AJAX, and then click a submit button to save their choice. Due to the way my AJAX…
Chris Sobolewski
  • 12,363
  • 12
  • 56
  • 95
5
votes
1 answer

Input type="file" showing weird behavior when used along with another input type

I have an input type="file" and an input type="text". When I choose the file first and then put text in the input box and click the Add button, the picture doesn't show but when I put the text first and then choose the picture (file), it behaves…
Hardik Aswal
  • 103
  • 8
1
2 3
11 12