I am working on an embedded project that implements a filesystem on a flash card. An embedded web server provides user interface and control through a web browser. One of the required functions is the ability to upload/download files to/from the embedded filesystem and the local (browser) filesystem. The upload function will be easy - using an HTML input type of "file" I can create a file selection box in the browser that displays a popup window and allows browse/selection of the local filesystem file to upload. The extension of the file will tell me where to put it in the embedded filesystem. The problem I'm facing is download - HTML5 provides a download attribute that pops up a window that shows me where to store it on the local filesystem. My problem is how to display the remote embedded filesystem directory so I can select which file to download. I can provide any information needed about that directory via the embedded web server, I just don't know how to (easily) create a nice browser popup window that will allow me to display/browse the remote filesystem. Is there any browser popup window that functions for the host side like there is for the client side?
Related
Google Chrome allows you to preview local PDF files in the browser like pictured below:
I am working on an extension that takes whatever PDF is in the browser preview and opens it in my custom editor/markup tool.
I have been successful in loading PDFs from remote URLs because I can just send the remote URL to my server, download it there, and open the PDF in my app using PDFjs.
How can I accomplish the same functionality for local PDF files?
I have looked into possibly using javascript to create a File object from local PDF files but Chrome doesn't allow access to the local file system.
I am hoping to accomplish this functionality by the user just clicking my extension icon, similar to the popular extension, Kami.
you need to add permissions to your extension:
"permissions": ["file://*/*"]
to ensure that you have permissions for local files, use:
chrome.extension.isAllowedFileSchemeAccess
P.S. have a good day and do not use upwork for these type of questions :-D
Is it possible to open a remote file via browser in the associated local app (Word/Excel/Photoshop etc.) and have the ability to save it back to the remote server?
I tried to find some solutions, but they seem to be unavailable:
WebDAV - it's impossible to just generate a link for the user - the user should make a lot of things (e.g. for Windows they must create a new disk drive).
FileSystem API - only in Chrome (it's ok), but it cannot be accessed from a local app. Only inside the browser with filesystem:* links.
Are there any other options? Maybe it's possible to do via an extension?
I am using Java Rest APIs to upload files in my project. Based on the configuration my files either goes into s3 bucket, google drive, one drive or even in local file system (in the same machine where my application is running). During download again I am making an ajax call which returns the file in response with Content Disposition header attachment; and browser downloads the file irrespective of its format. I want an option to view these files in the browser instead of downloading it directly. How can I do that ? (Especially formats like doc,xls etc)
As far as I know, there are no client-side libraries exist that can open .doc, .docs, .xls in browser. There is a way to render render your files using browser is to use Google Documents' Viewer or Microsoft Office 365 viewer via an <iframe>. Using this inside an <iframe> you can open your file in side your browser but can not edit.
Google Documents' Viewer inside <iframe>
<iframe src="http://docs.google.com/gview?url=http://example.com/path/to/your/document.doc&embedded=true"></iframe>
Google Documents' Viewer clickable link <a>
Open your doc file
Microsoft Office 365 viewer <iframe>
<iframe src='https://view.officeapps.live.com/op/embed.aspx?src=http://example.com/path/to/your/document.doc' width='1366px' height='623px' frameborder='0'></iframe>
Browsers don't have any built-in way to view Word docs so unless the user has configured their browser to open it with some plugin (which 99% of the world hasn't done), the browser will prompt them to download the file.
However, if you only need to display the Word Document, but don't need to edit it, you can use Google Documents' Viewer via an to display a remotely hosted .doc/.docx.
<iframe src="http://docs.google.com/gview?url=http://url-of-the-file&embedded=true"></iframe>
you can generate temporary URL for your s3 documents by keeping them private.
if you are interested in giving users privilege to edit them online then you can go with any tool like onlyoffice
Can a web app load an image from it's local store onto the webpage?
Thanks
What do you mean by "local store"?
If you mean the HTML5 applicationCache, then yes, any images that are in the applicationCache are available for use online or offline.
If you mean from the Web SQL database or the localStorage API, then yes, but the images must be base64-encoded as text and then loaded as data URLs.
If you mean the photos in the user's personal collection on a mobile device or computer, then no, that's not possible.
Use a manifest file. Google it.
It's 2 lines of code and you need to declare it in your .htaccess file
I should think not, as it can open vulnerable security risk:
If a web app can load an image from local storage, it means that there's a facility to browse local storage device (either via the browser JS engine or the web app). The malicious attacker can use this to gain valuable user information.
If the image could be loaded, what will be the path of the image? And if this path is valid, can every user viewing your web application open the image?
iPad doesn't have a storage directory like a PC (i.e. directory structure, e.g. home/user/* structure). Each application can store data that is only visible to the application (unless the application can allow sharing).
It's better to store image on server machine and load images from there.
I have a website with a directory listing of all the pdf files which I have uploaded via ftp. By clicking any of the file names, the pdf document will show up in your web browser. Is it possible for outside parties to digitally signed the document in the web browser and save it back into the server with a appended "signed" on the file name.
My main problem is:
saving the signed document back into the server via the web browser
change the file name when the document is saved
It will depend on your permissions but if the user downloads it via http (you have directory listing enabled on your website) they should not be able to save it back to the site unless you allow it to be uploaded.
I would suggest reading the PHP upload tutorial.
You might consider WebDAV, but I would not recommend it.