0 Replies
      Latest reply on May 8, 2020 12:23 AM by aditya-kalyani221
      aditya-kalyani221 Level 1 Level 1 (0 points)

        Hi

        We are using angularjs in our application and using input type="file" for uploading a document in the user's profile.
        The issu is that if the time difference between choosing the file and uploading the file is more than 30 seconds (roughly), then the file details are lost and it is consequesntly stored as an empty document in the database.

        directive('fileModelApply', ['$parse', function ($parse) {
          return {
          restrict: 'A',
          link : function (scope, element, attrs) {
          var model = $parse(attrs.fileModelApply);
          var modelSetter = model.assign;
        
          element.bind('change', function () {
          scope.$apply(function () {
          modelSetter(scope, element[0].files[0]);
          });
          });
          }
          };
        }])

        We are using the given directive for the part where user chooses the file.
        Please let us know if there i any way we can resolve this problem.