Set file name in the dialog of an input file

2

Good morning, I wonder if there is any way to set a default name in the input type="file"... dialog. And also if there is how to define the way in which this dialog will open. Eg "/ Downloads /", (I would always like to open that path).

IMAGE:

JSFIDDLE:

link

    
asked by anonymous 17.11.2015 / 12:02

2 answers

3

After a query to the HTML documentation, I confirmed that you do not have an option to set where the dialog will open.

What you can set is the type of files that will be accepted with accept:

  

accept
  If the value of the type attribute is file, this attribute indicates the types of files that the server accepts; otherwise it is ignored. The value must be the comma-separated list of unique content type specifiers:   A file extension starting with the STOP character (U + 002E). (E.g .: ".jpg, .png, .doc")
  A valid MIME type with no extensions
  audio / * representing sound files HTML5
  video / * representing video files HTML5
  image / * representing image files HTML5

Source: HTML Documentation

    
17.11.2015 / 13:32
3

So far, for security reasons it is not possible to set the folder in which the input file will open or the Predefined File Name.

This is done by security measure to prevent the user from submitting some file without realizing it.

Who needs stuff like that has to resort to java widgets, which makes the process heavier and bureaucratic.

    
17.11.2015 / 12:29