You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2021/12/13 11:42:39 UTC

[GitHub] [cordova-plugin-file-transfer] ChrisZinnecker edited a comment on issue #322: not uploading on android 30

ChrisZinnecker edited a comment on issue #322:
URL: https://github.com/apache/cordova-plugin-file-transfer/issues/322#issuecomment-992378593


   Can you check your logs in android studio?
   In my logs there appeared an error `The source url is not in the allow list ...`
   Somehow the allow list (previously the whitelist plugin, that is now included in cordova) didn't work for this plugin on my android installation, even when i allowed every url in my config `<access origin="*" />`.
   My workaround for this:
   1. Open the `FileTransfer.java` in your android project and plugins folder (`platforms/android/app/src/main/java/org/apache/cordova/filetransfer/FileTransfer.java` and `plugins/cordova-plugin-file-transfer/src/android/FileTransfer.java` for angular with cordova)
   2. Find following code snippet (in my project line 696): 
   ```
   if (!Boolean.TRUE.equals(shouldAllowRequest)) {
       LOG.w(LOG_TAG, "The Source URL is not in the Allow List: '" + source + "'");
      JSONObject error = createFileTransferError(CONNECTION_ERR, source, target, null, 401, null);
      callbackContext.sendPluginResult(new PluginResult(PluginResult.Status.IO_EXCEPTION, error));
       return;
   }
   ``` 
   3. Uncomment these lines or write your own allowed source url check
   
   I hope that fixes your problem


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org