Closed misharysh closed 3 years ago
Kindly send me your full code (if also with the real link it will be better)
And i will check it tomorrow
Regards,
Mostafa Mansour Software Engineer 00971 524988466 0020 1113019196
On 15 Feb 2021, at 9:01 PM, misharysh notifications@github.com wrote:
I am using latest version of your plugin. I have a specific case when an error occurs. A link is sent to me from the server that does not have an extension. In this case i am using 'previewPath' method. also i have next parameters: mimeType : 'application/pdf', name: 'test.pdf' . When i open this document on Android device the name of it (on the top header ) is without extension and when i click 'download' it saves it as a file without extension. iOS works correctly. And saving works correctly if my url contains extension. Can you check it pls in your side?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/mostafa-mansour1/previewAnyFile/issues/17, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABSFOB3DD5QQBYY44MA2H3LS7FHOZANCNFSM4XVAMM7A.
var parameters = {}; var docName = doc.Name.replace(/\s/g, '_') + '.pdf'; parameters = {mimeType : 'application/pdf', name: docName};
PreviewAnyFile.previewPath(
function(win){
if (win == "SUCCESS") {
console.log('success');
}else{
console.log('error');
}
},
function(err){
console.log('err',err);
}, doc.doc_url, parameters);
I see you are trying to use the plugin to download the file to the device of the user, not view it.
The purpose of the plugin is just to preview the file content to the user, when you provide an internet link, android open this link directly
in IOS, we haven't that option so I downloading the content of the file locally then preview it,
I tried to do that in android but I faced extra issues, and it needs extra permission, and the final behavior is the same.
so I don't recommend applying this.
if you need to download the file from the internet, try using an HTTP request or fetch from javascript then you can preview the base64 from our plugin
I am using latest version of your plugin. I have a specific case when an error occurs. A link is sent to me from the server that does not have an extension. In this case i am using 'previewPath' method. also i have next parameters: mimeType : 'application/pdf', name: 'test.pdf' . When i open this document on Android device the name of it (on the top header ) is without extension and when i click 'download' it saves it as a file without extension. iOS works correctly. And saving works correctly if my url contains extension. Can you check it pls in your side?