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

View remote pdf if url has no extension? #13

Closed
julia-fix opened this issue Jan 29, 2021 · 5 comments
Closed

View remote pdf if url has no extension? #13

julia-fix opened this issue Jan 29, 2021 · 5 comments

Comments

@julia-fix
Copy link

Is it possible to somehow specify extension other way than in url? I have dynamically generated PDFs in a remote server with urls like "https://mysite.com/pdf/1234" and plugin fails to open these. Need this only for iOS, if that matters

@mostafa-mansour1
Copy link
Owner

mostafa-mansour1 commented Jan 30, 2021 via email

@julia-fix
Copy link
Author

Solved this by downloading file with FileTransfer plugin and then opening local file. Requires more code but also was able to delete local file immediately after closing viewer, to free device memory. Thanks for a great plugin!

@karimslim
Copy link

@July-,
You could use: var fileExt = fileURL.split('.').pop(); to get the file extension.
Then
window.PreviewAnyFile.previewPath(
(res:any) => callbackSucces(res),
(error:any) => callbackFailure(error),
fileURL,{name : "file."+fileExt}
);

Hope this will help!

@julia-fix
Copy link
Author

Adding file name to remote link was not available when I integrated plugin to my app, this is probably a new option. Maybe will rewrite code to use this update, thanks

@mostafa-mansour1
Copy link
Owner

yes the updated plugin has the option to add the name or extension the function

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

3 participants