Discussions

Expand all | Collapse all

Remove file attachment with button

  • 1.  Remove file attachment with button

    Posted 01-31-2020 09:01
    Hi, I was wondering if there was a way to remove file attachments from a form using a button?

    ------------------------------
    GMacri
    ------------------------------


  • 2.  RE: Remove file attachment with button

    Posted 01-31-2020 09:07
    Not tested but my notes say that this will work.  Can you post back with your working code when it works?

    URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
    & "&_fid_9="
    & "&delfile_fid_9=1"
    // & "&apptoken=<your apptoken>"

    // obviously 9 would be replaced with the field ID of your file attachment field.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Remove file attachment with button

    Posted 01-31-2020 09:09
    The complete code would be this


    var text URL = URLRoot() & "db/" & dbid() & "?act=API_EditRecord&rid=" & [Record ID#]

    & "&_fid_9="
    & "&delfile_fid_9=1";


    "javascript:" &
    "$.get('" &
    $URL &
    "',function(){" &
    "location.reload(true);" &
    "});"
    & "void(0);"


    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 4.  RE: Remove file attachment with button

    Posted 01-31-2020 09:39
    Hmm, this would work great but I'd require some additional tweaking:

    1. When regarding the removal, i mean as though an individual uploaded the wrong file, saw the issue, and instead of clicking upload file and hitting cancel, is there a way to get create a button which just removes all "Pending" file attachments

    2. Don't want to expose the API token to the end user at this time.

    ------------------------------
    GMacri
    ------------------------------



  • 5.  RE: Remove file attachment with button

    Posted 01-31-2020 13:42
    Bumping this post

    ------------------------------
    GMacri
    ------------------------------



  • 6.  RE: Remove file attachment with button

    Posted 01-31-2020 13:44
    I don't have answers to your followup question.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------