Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cordova.plugins.fileOpener2.open() wont work on Windows #51

Closed
zulalay opened this issue Nov 25, 2015 · 8 comments
Closed

cordova.plugins.fileOpener2.open() wont work on Windows #51

zulalay opened this issue Nov 25, 2015 · 8 comments

Comments

@zulalay
Copy link

zulalay commented Nov 25, 2015

I am using Apache Cordova in Visual Studion 2015 and running the project as WIndows project.

In the app, I download pdf file and then try to open it using

cordova.plugins.fileOpener2.open(
        options.filePath,
        options.fileType,
        {
            success: function () {
                console.log('[DEBUG] file opened successfully');
            },
            error: function (error) {
                console.log('[ERROR] status: ' + error.status + ' - Error message: ' + error.message);
            }
        }
    );

where options.filePath is 'ms-appdata:///local//cache.pdf'
and options.fileType is 'application/pdf'

However i get :
Exception is about to be caught by JavaScript library code at line 49,
column 14 in ms-appx-web://<package_name>/www/plugins/cordova-plugin-file-opener2/src/windows/fileOpener2Proxy.js

0x80070057 - JavaScript runtime error: The parameter is incorrect.

Any ideas what can be wrong with my parameters?

Thanks

@pwlin
Copy link
Owner

pwlin commented Nov 27, 2015

Hi @Gillardo can you please take a look into this issue? Does this have something to do with the recent PR changes we merged into the master? Thanks very much.

@Eeems
Copy link
Contributor

Eeems commented Dec 5, 2015

I'm also having this issue.

@Gillardo
Copy link
Contributor

Gillardo commented Dec 5, 2015

Sorry been bit busy. I will check this soon. The pr changes were done by
someone else but i can look still. I am using the plugin but i am using the
full device path and it works for me
On 5 Dec 2015 01:06, "Nathaniel van Diepen" notifications@github.com
wrote:

I'm also having this issue.


Reply to this email directly or view it on GitHub
#51 (comment)
.

@pwlin
Copy link
Owner

pwlin commented Dec 5, 2015

Thanks @Gillardo for looking into it. Maybe @ielcoro knows how to fix this?

@ielcoro
Copy link
Contributor

ielcoro commented Dec 5, 2015

I will look into it

@pwlin
Copy link
Owner

pwlin commented Dec 5, 2015

Thank you very much @ielcoro !

@zulalay
Copy link
Author

zulalay commented Dec 7, 2015

i tried to use path "ms-appdata:///local/cache.pdf" and it looks like it works!

i used 'ms-appdata:///local//cache.pdf' before which didnt work. (difference is the extra '/')

however i think that generally correct way to describe the path should be with double "/".
i get the path value using new Ext.device.filesystem.FileEntry(fileName, filesystem).getEntry(...)
and it returns the path with double "/".

@zulalay zulalay closed this as completed Dec 8, 2015
@ielcoro
Copy link
Contributor

ielcoro commented Dec 8, 2015

@zulalay sure, the extra / is wrong, paths should use only one /.

I think that what you are sawing when calling Ext.device.filesystem.FileEntry is visual studio and .net escaping the value /, however under the hood it does not have two / at all, only one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants