I am build an ionic app and I am almost done. Now I have a problem. whenever user clicks on attachments in my app.. there are .doc, .xls, .jpeg, .pdf files. I am getting the base64 code converting it and generating a local url. I can open Pdf and all image files but I have problems in opening .doc an d.xls files. Could anyone suggest me how to open them ..Thanks in advance :)
Related
I have written an application where on button click a .docx file is generated on the server and returned to client as base64 string. What I want to do now, is to let the user download the file in a directory of their choice.
To demonstrate what I mean, if I instead want to upload a file having a <input type='file'/> opens a dialog such like this
Where I can select the file. Is there any way to open this kind of dialog for a download button? I understand that the web-page doesn't receive the actual path on a clients pc for security reasons, but if you can chose an upload file, there is no reason to not chose a download path right?
No, for security reasons this is not possible.
See:
https://github.com/eligrey/FileSaver.js/issues/42
I have a JS code which should download a file and need to open that corresponding file. I'm able to download it but need a JavaScript code to open the recently downloaded file from any browser.
Answer is No.
Why :
When user download file into his local file system then downloaded file became a part of users file and as you know you can't access any file/directory from users local file system.
Alternative solution :Yes
Download file using XmlHttpRequest (AJAX) into blob object help link
Open file from saved blob object.
in above alternative solution You can also allow use to save file(download file).
Please, I need some help from you guys. I am developing a Phonegap application for Android that downloads some PDF files on a file explorer style interface and them open the files on the Adobe Reader application. The app works well on success scenarios, but if for some reason the connection drops during the download and you close and reopen the application, when you click the pdf file's icon, he tries to open the file - I cache the files on the internal storage, I only download if the file doesn't exists - and adobe reader shows a error of corrupted file. Is there a way on Cordova that I can check if a file is corrupted, so I can download it again if it is corrupted?
thank you
Wouldn't it be easier to keep a flag for each of the files you download to indicate that the download has completed? Once the file finished downloading you set a flag for that file. That way if a transfer is interrupted then the flag won't be set and you can treat that case as if the file doesn't exist so that your application doesn't try to open an incomplete file.
I have requirement to view .doc file inside android app, I have gone through many related post but still not clear what to do.
I have tried :
aspose word api for android I got api for creating .doc file but there is not a specific method to view .doc file.
I gone through apache POI but there is i have to write function for render content.
Embedding .doc inside Webview Does not work for local files.
Olivedoc Library is missing.
Please suggest me if there is any library for .doc file same as pdfViewer for PDF.
Thanks.
Look here. AFIK there is no library for rendering such files in android (Correct me if I'm wrong). You have to create an intent to open your file in an external app, as described in the linked question.
If you want to render the new .docx or OpenOffice .odp files, there are various libraries (search on github).
I know this is not what you want to hear, but there does not seem to be any way to do what you want. (BTW, WebView does work for local files, but cannot render .doc files.)
Recently, I am working on a feature which the user could upload files like .pdf or .doc and then viewing them as pics on the web page. I am wondering is there a way that I can do that without actually converting them to .jpg or .png by a third party software on the server? Is it possible to implement this feature only us js,jquery and django?
Not sure about .doc you would need to go and convert that into PDF. You can show PDFs by using created by Mozilla
pdf.js