Milligram: file input support request.

Created on 14 Apr 2017  ·  4Comments  ·  Source: milligram/milligram

Please kindly support for file input save as and open file input. tia

Hacktoberfest

Most helpful comment

It is possible to achieve with something like this:

    <label for="files" class="button file-label">Upload
    </label>
    <input
      onchange="yourUploadHandler(e)"
      accept=".csv, .doc, image/*"
      class="hidden"
      id="files"
      type="file" />
.file-label {
  width: 15rem;
}
input[type=file].hidden {
  visibility: hidden;
  width: 15rem;
  margin-left: -15rem;
}

Heads up; do not wrap the label around the input, this will make IE (at least Edge) to go bonkers.

All 4 comments

It is possible to achieve with something like this:

    <label for="files" class="button file-label">Upload
    </label>
    <input
      onchange="yourUploadHandler(e)"
      accept=".csv, .doc, image/*"
      class="hidden"
      id="files"
      type="file" />
.file-label {
  width: 15rem;
}
input[type=file].hidden {
  visibility: hidden;
  width: 15rem;
  margin-left: -15rem;
}

Heads up; do not wrap the label around the input, this will make IE (at least Edge) to go bonkers.

@marcusasplund it's very impressive! Okay for you if I add this feature in the next version?

Yes, of course!

@faststare Inspire by @marcusasplund, I add this feature #249
Now I will close this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

luisaceituno picture luisaceituno  ·  6Comments

mikeriley131 picture mikeriley131  ·  8Comments

kresogalic8 picture kresogalic8  ·  5Comments

negativefix picture negativefix  ·  7Comments

roryprimrose picture roryprimrose  ·  7Comments