Skip to content

Instantly share code, notes, and snippets.

@arun12209
Created June 23, 2019 15:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arun12209/b3624c4e05110fef3dba1a0cdafbe49c to your computer and use it in GitHub Desktop.
Save arun12209/b3624c4e05110fef3dba1a0cdafbe49c to your computer and use it in GitHub Desktop.
FileUploaderCmp
<aura:component controller="SimplyfyFilesCntrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="files" type="ContentDocument[]"/>
<aura:attribute name="recordId" type="string"/>
<aura:attribute name="accept" type="List" default="['.jpg', '.jpeg','.pdf','.csv','.xlsx']"/>
<aura:attribute name="multiple" type="Boolean" default="true"/>
<aura:attribute name="disabled" type="Boolean" default="false"/>
<div class="slds">
<div style="border-left: 1px solid rgb(221, 219, 218);
border-right: 1px solid rgb(221, 219, 218);
border-bottom: 1px solid rgb(221, 219, 218);
border-top: 1px solid rgb(221, 219, 218);">
<div class="slds-page-header" style="border-radius: 0px; border-right: 0px;border-left: 0px;border-top: 0px;
box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.1);">
Files
</div>
<div class="slds-grid">
<div class="slds-col slds-size--5-of-12">
<lightning:input type="text" name="input1" label="Enter File Name" aura:id="fileName" />
</div>&nbsp; &nbsp;
<div class="slds-col slds-size---of-12">
<lightning:fileUpload label="" multiple="{!v.multiple}"
accept="{!v.accept}" recordId="{!v.recordId}"
onuploadfinished="{!c.UploadFinished}" />
</div>
</div><br/>
<table class="slds-table slds-table--bordered">
<thead>
<tr>
<th>Title</th>
<th>FileType</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<aura:iteration items="{!v.files}" var="f">
<tr>
<td> <a href="" id="{!f.Id}" onclick="{!c.OpenFile}">{!f.Title}</a></td>
<td>{!f.FileType}</td>
<td>{!f.Description}</td>
</tr>
</aura:iteration>
</tbody>
</table>
</div>
</div>
</aura:component>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment