File Preview and Download Using LWC | Lightning Web Component

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2024

ความคิดเห็น • 51

  • @aakivlogs9499
    @aakivlogs9499 6 หลายเดือนก่อน

    Nice tutorial. Keep up the great work ever. Thanks a lot.

  • @ReinierLopez-lu9dz
    @ReinierLopez-lu9dz ปีที่แล้ว

    Great tutorial, simple and powerful, thank you for sharing this !

  • @dmitry7239
    @dmitry7239 2 ปีที่แล้ว

    Great tutorial step by step. Thanks a lot! Good expertise, actually i didn't know about the grid_generator👍👍👍

  • @GUNJANASWANI
    @GUNJANASWANI 3 ปีที่แล้ว +4

    Can you share how to open same file using same LWC component in Community?

  • @triaabderahmane5900
    @triaabderahmane5900 3 ปีที่แล้ว

    Thanks, a very good stuff as usual, simple, clear and very useful.

  • @shejalsawant9772
    @shejalsawant9772 ปีที่แล้ว

    Hello, this tutorial was very useful for me I also have one question if we want to delete file how to do it ?

  • @randomly717
    @randomly717 ปีที่แล้ว

    greate tutorial ,please make vedio on how to download Account object All field records in file object in PDF format ....thanks

  • @swetadey3227
    @swetadey3227 2 ปีที่แล้ว +1

    Hi, how can we preview csv file or xls file in this? what approach do we have to follow for it?

  • @gustavozanatta8786
    @gustavozanatta8786 3 ปีที่แล้ว +1

    Hi, Nikhil
    Thanks for share this.
    I have a question, is possible refresh the component automatically always a new file is uploaded in the record?

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว +2

      In our approach currently not. But if your file upload is a separate component you can trigger an event to filePreviewAndDownload component and refresh the apex explicitly

  • @raghavendrasharma815
    @raghavendrasharma815 3 ปีที่แล้ว

    Good

  • @shikhachaurasia5580
    @shikhachaurasia5580 2 ปีที่แล้ว

    Thanks, It's great .Could you explain, How to add in community page?

  • @abhichohan8837
    @abhichohan8837 ปีที่แล้ว

    How can we use the pdf download functionality without using Scoped imports '@salesforce' ?
    Because to use scoped imports, we need to turn on LWS under session settings, and enabled LWS affects the custom LWC components.

  • @mandarshinde2507
    @mandarshinde2507 2 หลายเดือนก่อน

    Can you share how to open file using same LWC component in community site

  • @pallerlapradeep9955
    @pallerlapradeep9955 2 ปีที่แล้ว

    Hi. I have a lwc which display as a credit card model UI. So when I click on download button i need that displayed card as an image.Png. pls suggest

  • @winstonye478
    @winstonye478 3 ปีที่แล้ว

    Thank you for posting this. I was wondering, is this feature available within an community page? I tried implementing it and I can grab the Id from the content document, but I am not able to preview/download the document.

    • @snehagupta5245
      @snehagupta5245 ปีที่แล้ว

      did you get the answer?If yes, whats the solution?

  • @rajat19961
    @rajat19961 3 ปีที่แล้ว +1

    What if we dont want to preview file on full screen. I want to show file in div. Can we achieve this?

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว

      Yes using .

    • @rajat19961
      @rajat19961 3 ปีที่แล้ว

      What to use in src?

    • @rajat19961
      @rajat19961 3 ปีที่แล้ว

      I tried using lightning:fileCard in but it was giving error

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว

      @@rajat19961
      get url() {
      return '/sfc/servlet.shepherd/document/download/' + this.fileId;
      }
      try this

  • @tarakram8083
    @tarakram8083 11 หลายเดือนก่อน

    Hii..
    That preview not showing in Salesforce mobile app . How can i see the preview in mobile app

  • @yunhu99
    @yunhu99 3 ปีที่แล้ว

    Is File should be in Salesforce? Can I preview file which is on other cloud based doc server?

  • @kep5358
    @kep5358 3 ปีที่แล้ว

    Good Stuff Nikhil. If I want to download all attachments in a single click how can Manage it? Thanks in Advance.

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว

      create a button and on click of that fetch all the a tags that has download link and trigger click using js. It will work.

    • @kep5358
      @kep5358 3 ปีที่แล้ว

      @@salesforcetroop Thanks! I did the same thing. But For each attachment it opening new window and closes automatically. Do you have any idea to stay at same window and download all attachments.
      download(recordId) {
      console.log(recordId);
      this[NavigationMixin.Navigate]({
      type: 'standard__webPage',
      attributes: {
      url: window.location.origin + '/sfc/servlet.shepherd/document/download/' + recordId
      }
      }, false);
      }

  • @user-ls2fh2jc1y
    @user-ls2fh2jc1y 9 หลายเดือนก่อน

    that will work for .CSV file or not

  • @mamadakbar9048
    @mamadakbar9048 3 ปีที่แล้ว

    how to get a file extension along with an Id and label?

  • @chithraprakash8392
    @chithraprakash8392 ปีที่แล้ว

    Can you also tell how to print the files

  • @mouryascrazy6786
    @mouryascrazy6786 ปีที่แล้ว

    Hi I can't find custom components my components are empty

  • @mangeshabhang2607
    @mangeshabhang2607 3 ปีที่แล้ว +2

    this is available in Salesforce and your logic doesn't work in communities

  • @saikomal9605
    @saikomal9605 3 ปีที่แล้ว

    Hi, Nikhil
    Thanks for the good stuff . Its very useful.
    I have question will it be worked in community page as well if we pass the id? Or will it be different?

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว +1

      in Community named__page navigation is not possible currently. You can try something like this
      handleFilePreView(event){
      this[NavigationMixin.Navigate]({
      type: 'standard__recordPage ',
      attributes: {
      pageName: 'filePreview',
      recordId: event.target.value,
      objectApiName: 'ContentVersion',
      actionName: 'view',
      },
      state: {
      selectedRecordId: event.target.value,
      },
      });
      }

    • @jeahernandezg
      @jeahernandezg 3 ปีที่แล้ว

      @@salesforcetroop it doesn't work :(

  • @KatakamAkhil
    @KatakamAkhil 3 ปีที่แล้ว

    hi , i was not able to open the file after clicking on preview button

    • @salesforcetroop
      @salesforcetroop  3 ปีที่แล้ว

      There may be some issue in your code or may be u are using this in community,

    • @KatakamAkhil
      @KatakamAkhil 3 ปีที่แล้ว

      @@salesforcetroop thanks for the reply ,I have done mistake near event.target.dataset now it’s clear
      Thanks for this video

    • @balamuruganm5988
      @balamuruganm5988 3 ปีที่แล้ว

      @@KatakamAkhil is it working for community ???

    • @SarveshNaik-lt2xk
      @SarveshNaik-lt2xk 6 หลายเดือนก่อน

      check the visibilty of the fiile by querying