@Override
  protected Boolean doInBackground(Void... params) {

    Log.d(TAG, "doInBackground() ...");

    FileInputStream fileInputStream = null;
    try {
      fileInputStream = new FileInputStream(file);
    } catch (Exception e) {
      Log.e(TAG, "doInBackground() file exception=" + e);
      allGoodToGoFlag = false;
    }

    if (allGoodToGoFlag) {
      try {
        uploadRequest =
            dropboxAPI.putFileOverwriteRequest(
                DROPBOX_PHOTOS_PATH + file.getName(),
                fileInputStream,
                file.length(),
                new ProgressListener() {
                  @Override
                  public long progressInterval() {
                    return 2000;
                  }

                  @Override
                  public void onProgress(long b, long total) {
                    publishProgress(b);
                  }
                });

        Log.d(TAG, "doInBackground() about to call upload()...");
        uploadRequest.upload();
        Log.d(TAG, "doInBackground() (hopefully) uploaded");

      } catch (Exception e) {
        Log.e(TAG, "doInBackground() upload exception=" + e);
      }
    }

    return true;
  }