Skip to content

Path is not separated from filename #13

@Anid4u2c

Description

@Anid4u2c

When uploading from local storage: I was hoping to have a choices of manually naming (current implementation), automatically generating a filename for the image, or pulling the filename from the file.

Here is what I did to get the filename of the image, from local storage...

  1. In /file-fire/file-fire-behavior.html
    Updated _uploadNext and changed the following from:
    var name = this.path;
    to:
    var name = this.path + files[i].name;

  2. With the previous edit to the existing code, the configuration only requires the path and the name is automatically set by the existing filename:
    <file-fire app-name="app" path="/images/"

From the code supplied in the demo, I was able to output the name (see [[item.name]] in addition to the download-url (see [[item.url]]):

<br><br>URl's: <br>
<template is="dom-repeat" items="{{downloadUrl}}">
  [[item.url]]
  <br/>
  [[item.name]]
</template>
<br> <br> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions