0

I am setting up a drag and drop file upload using lightning:input as type=file and it works fine when dragging from a local folder. But when I try to drag an Outlook attachment, it doesn't recognize anything. Is this just incompatible with files directly from Outlook or is there some trick I'm missing? The input is below for reference. The onchange event is meant to add the most recent batch of files to an array so dropping files multiple times won't overwrite all files dropped previously. Thanks!

<lightning:input aura:id="fileInput" type="file"
                         files="{!v.droppedFiles}"
                         accept="bunch of file types here"
                         label="Files"
                         name="file"
                         multiple="true"
                         onchange="{!c.addFiles}"/>
  • Why not use lightning:fileUpload – Itai Shmida Jan 11 '18 at 13:21
  • @ItaiShmida A couple reasons. The first is because I am saving the files to an external file manager and not to Salesforce, so the input component seems more direct as I don't need to save to Salesforce, then move to the external system, and then delete from Salesforce. The second is that the documentation for fileUpload just doesn't seem as robust at this point. – mplax Jan 15 '18 at 17:21
  • For what it's worth, I tested out using lightning:fileUpload in place of lightning:input and it was not able to handle files dropped from Outlook either. – mplax Jan 24 '18 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.