ipad web app load local image - javascript

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.

Related

How to display a video on the site without the user being able to download it in any way. In ASP.Net MVC

I am going to build an educational site where users will not have access to the original video file and will only be able to watch it through the site. Is there a way that the file is not recognized by the IDM plugin?
According to the articles I read on the Internet, blob can be used, but there was no solution for local use of Azure Storage blob.
In terms of preventing downloads via browser plugins like IDM, you can use
streaming to send the video content in small chunks rather than as a single file. This can make it hard for plugins to intercept and download the entire file. Azure Blob Storage supports "pseudo streaming" of video content via the "Range" header in HTTP requests. This can be useful - https://stackoverflow.com/a/15166547/13105803
Or another option is to use Azure media service

Use PHP/Javascript to access/display client-side files

I've built an online photo tagging tool that has a low-res mirror of what is on my local laptop. I'd like to find an easy way to display the high-res version of a given image from my local file system.
Currently I have to get the image name from the web tool, paste it into Lightroom's search system and view that way. I'd like to be able to pull up the high res version, either in the browser or another local app, with a single click.
Options I've investigated:
HTML5 File API/FileReader()/fetch()
These cause even more friction than going to Lightroom, as the user has to select files via the OS file selector and the image directory structure is complex.
Configure local web server to host disk-based images
I've looked at hosting the local image directory with a simple web service, but would need to configure HTTPS to prevent cross-zone violations, and that's more client-side config than I'd prefer.
Any solution that would allow me to reference a local file path directly would work, but modern browsers have (rightly) eliminated most direct paths to local file access.
I'm wondering if there is a way to ask an app on the client side to open the file, in the way that browsers will prompt you for permission to open Zoom and join a meeting, or open a link in the client OS app store. If I could find some way to tell Lightroom to open the specific image without having to copy/paste file names, etc.

Get the local directory path of the app where web app is loaded

Can I get the path of chrome/Mozilla where my web app is loaded which is created in react can fetch the local directory path of the app(Chrome/Mozilla etc)? Because I want to store the data of website on that location.
Like if I am browsing on Chrome, then I get the path of chrome where it is stored in the local directory.
You cannot browse through the client’s machine using javascript. It would be a major security flaw if you could do that. Just think, someone from the internet having access to your local files! If you are looking to store some data persistantly on the client side you can use.
cookie
localStorage
indexDB
sessionStorage
Thats pretty much it.

PWA: How to store pdf in local storage or local device with Javascript/HTML 5?

I am setting up a progressive web app with PWA Builder. I need to download pdf, once I Progressive web app downloaded on the local device after disconnected internet than I check again click to the link of pdf for downloading. I tried but the PDF file doesn't download. Please suggest.
First of all, I think you must have internet connection to download pdf first. Then, convert it to base64 and store inside localStorage. Once user open your web app again, check if he/she open same pdf as we stored, show it from localStorage.
Edit: I don't think you couldn't be able to cache in service worker. That's only for predefined data.
There's two more options:
- websql
- indexsql
- pouchsql
https://www.sitepoint.com/offline-web-apps-service-workers-pouchdb/

How to access and browse a network share via browser using javascript?

I'm helping a coworker to code an html page that has to display contents (documents) of a local network share.
Html page will not be served by any web server, it will be just a plain html page on file system.
Does anyone know some Javascript libraries that let users browse the share, listing files and folders?
No, it doesn't exist. Same origin policy makes this problematic.
If such a javascript existed it would have to be served by the system and port that the file share was on. Which sounds like it defeats the point.
Now there is an index listing service built into most web servers that can list the contents of a web folder for a browser. There is also a similar capability in the browser for ftp.

Categories

Resources