Code Monkey home page Code Monkey logo

Comments (15)

pwlin avatar pwlin commented on August 21, 2024

Hi @dnwts

The WP8 part of this plugin is graciously contributed by @Gillardo and I think he might be in a better position to help you, as I can only test the Android parts. Can you please open a ticket on his fork to see if he is able to reproduce this bug?

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

Will do. Thanks

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

@pwlin Hmm, it seems i cannot add an issue there. Can you please send him a message to review this issue? I can't reach him..

2015-05-07_1423

from cordova-plugin-file-opener2.

pwlin avatar pwlin commented on August 21, 2024

I have posted a comment on the related pull request #26 (comment)

Hopefully he can help fixing this bug. I am really sorry for not being to help personally.

from cordova-plugin-file-opener2.

Gillardo avatar Gillardo commented on August 21, 2024

Hi there.

Will have a look for you. My original code was specific to an application
that I built so probably not striped something out. Will have a look as
soon as I can for you.
On 7 May 2015 12:36, "pwlin" [email protected] wrote:

I have posted a comment on the related pull request #26 (comment)
#26 (comment)

Hopefully he can help fixing this bug. I am really sorry for not being to
help personally.

β€”
Reply to this email directly or view it on GitHub
#27 (comment)
.

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

@pwlin no problem mate, i know you do your best and i appreciate your responsiveness πŸ‘ although i think i should've just mentioned @Gillardo ? :)

However, i think there's a chance we'll be aborting the FileTransfer -> FileOpener2 route for downloading and opening files, and we'll just open the download URL's in the system browser, as it's also much faster than FileTransfer at downloading stuff.

So basically, if i have my http://server.com/path/to/file.doc uri in a uris variable, i'll do:

await Windows.System.Launcher.LaunchUriAsync(new Uri(uri));

And this currently seems to work ok on WP8.1 but then again i only tested with a couple of documents. I'm also leaving on a week long holiday so we'll see after that, i'll come back with findings.

Cheers

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

Oh, hi @Gillardo :) Thanks! It would be great for this to work in case my workaround fails or gets rejected by the client :)

from cordova-plugin-file-opener2.

Gillardo avatar Gillardo commented on August 21, 2024

What file path are u using to open the file?
On 7 May 2015 13:04, "dnwts" [email protected] wrote:

Oh, hi @Gillardo https://github.com/Gillardo :) Thanks! It would be
great for this to work in case my workaround fails or gets rejected by the
client :)

β€”
Reply to this email directly or view it on GitHub
#27 (comment)
.

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

On the previous (wp8.0) version it was only using the file name, so that's what i was sending (just the file name) and it used to be like this:

var fileName = System.IO.Path.GetFileName(args[0]);
[...]
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile file = await local.GetFileAsync(fileName);

I listed the local folder and my file is getting there, but now this line

StorageFile file = await Windows.Storage.StorageFile.GetFileFromPathAsync(args[0]);

tells me the path is invalid. I'll try to play with the paths, maybe that's what's wrong. If you can't reproduce the issue, don't worry about it and i'll test it more thoroughly when i get back from my holiday. Thank you very much for looking into this πŸ‘

from cordova-plugin-file-opener2.

Gillardo avatar Gillardo commented on August 21, 2024

Oh that's easy.

U need to pass in the full path for windows 8.1 and thus windows phone 8.1
as because u can use it on a pc the file could be anywhere.

Maybe I could add a setting to search in the local folder first and if not
found, then search for file.

But for now, if u pass in the full path it will work.
On 7 May 2015 15:16, "dnwts" [email protected] wrote:

On the previous (wp8.0) version it was only using the file name, so that's
what i was sending (just the file name) and it used to be like this:

var fileName = System.IO.Path.GetFileName(args[0]);
[...]
StorageFolder local = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile file = await local.GetFileAsync(fileName);

I listed the local folder and my file is getting there, but now this line

StorageFile file = await Windows.Storage.StorageFile.GetFileFromPathAsync(args[0]);

tells me the path is invalid. I'll try to play with the paths, maybe
that's what's wrong. If you can't reproduce the issue, don't worry about it
and i'll test it more thoroughly when i get back from my holiday. Thank you
very much for looking into this [image: πŸ‘]

β€”
Reply to this email directly or view it on GitHub
#27 (comment)
.

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

What would be the full path? Maybe this?

String fullPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path + "/" + fileName;

from cordova-plugin-file-opener2.

Gillardo avatar Gillardo commented on August 21, 2024

Yes but think u need to use \ instead of /.

On windows 8.1 machine it is something like c:....
On 7 May 2015 15:34, "dnwts" [email protected] wrote:

What would be the full path? Maybe this?

String fullPath = Windows.Storage.ApplicationData.Current.LocalFolder.Path + "/" + fileName;

β€”
Reply to this email directly or view it on GitHub
#27 (comment)
.

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

Cool, thanks! I'll be off now, i'll post back when i get back on it :)

from cordova-plugin-file-opener2.

pwlin avatar pwlin commented on August 21, 2024

Hey @Gillardo Thanks for your help :)

from cordova-plugin-file-opener2.

steodor avatar steodor commented on August 21, 2024

Hi there, i'm back :)

I tried what @Gillardo suggested but it didn't work. I don't think it's because of your code though, given it's working on your end, but more because of our possibly sloppy upgrade (it was kinda hectic). But, since WP8.1 didn't deliver the promised debugging capabilities and also introduced another bug which was a deal breaker and we simply couldn't fix (unrelated, some keyboard issue), we decided to revert to WP8.0 and we've got it working fine.

@pwlin @Gillardo Thank you very much for your help :)

from cordova-plugin-file-opener2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.