Changeset 7169


Ignore:
Timestamp:
Jun 9, 2016, 10:36:00 AM (7 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #2018: It is not possible to abort a file upload

Sort of... I really don't know how to ensure the abort is happening from the server-side. Instead we are simply sending the "Abort" command to the server and then closing the upload dialog. This should work in most cases. There is a race-condition between the "Abort" message and finalizing the file upload so in some cases the file may have been uploaded successfully despite giving the user the impression that it was aborted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/filemanager/upload/upload.js

    r6389 r7169  
    254254    if (confirm('Are you sure you want to abort the upload? It cannot be resumed.'))
    255255    {
     256      /*
     257      Aborting from server-side is not working
     258      See ticket: http://base.thep.lu.se/ticket/2018
     259      Sending "Abort" command to the server and then
     260      forcefully closing the window and hoping for the
     261      best.
     262      */
    256263      var request = Ajax.getXmlHttpRequest();
    257264      var url = 'ajax.jsp?ID='+App.getSessionId();
     
    259266      request.open("GET", url, true);
    260267      request.send(null);
     268     
     269      var url = '../../common/close_popup.jsp?refresh_opener=1&message=Upload+aborted';
     270      window.top.location = url;
    261271    }
    262272  }
Note: See TracChangeset for help on using the changeset viewer.