0

I have two inputs that are the same

<input type="file" size="30" name="upload_file" class="form-mobile-col-1">

They both allow the user to upload a file. One of the inputs is hidden and I need to copy the contents that are uploaded to the input displayed to the user over to the input that's hidden.

How can I do this using javascript/jquery?

MalcolmInTheCenter
  • 1,376
  • 6
  • 27
  • 47
  • Have you tried anything? – j08691 Feb 22 '17 at 21:28
  • 1
    No, it is not possible to set `.files` property of `` element. Though you can call `File.prototype.slice()` to create a copy of the `File` object itself. Why do you need to create a copy of `File` object? – guest271314 Feb 22 '17 at 21:28

1 Answers1

0

One word: Impossibru `o´

File inputs are more limited that other inputs. Security reasons I guess.

As an addition: I can't think of any reason for that to be a good solution of something. Tell us more detailed what do you want to achieve and we could help you find a better approach.

Jorge Fuentes González
  • 11,568
  • 4
  • 44
  • 64