Convert a percent-encoded file URI to a file path.
#include <bps/navigator_invoke.h>
BPS_API char* navigator_invoke_uri_to_local_path(const char *uri)
BlackBerry 10.0.0
The URI encoded file path. It needs to start with "file:///".
The navigator_invoke_uri_to_local_path() function can be called to convert file URIs retrieved from invocation events to file paths. This function expects uri to start with "file:///", and handles percent-encoded URIs.
This function allocates memory that needs to be freed by the bps_free() function.
char *file_path = navigator_invoke_uri_to_local_path("file:///path/to/some%20file.txt"); // file_path is "/path/to/some file.txt" bps_free(file_path);
The local file path upon success; NULL with errno set upon failure.