Avatar of Amhazing
AmhazingFlag for Australia

asked on 

Offline "file upload" so can switch image in a HTML page while offline (store images in localstore/HTML 5 etc)

Hi Guys,

Working on a  HTML 5 web page for mobile devices (i.e. Android and iPhone) that simply displays an image that can be replaced with images stored on the local device by the user even when they're offline.

I want to avoid using phonegap etc as I don't want to have to distribute through various app stores (not looking to do this for money) so looking to do it all through "standard" web browser functionality (which means I need to use at least Android 2.2 so that I can get file upload button :) although there's still some question as to if that's working properly yet..)

Main problem keep encountering is one of browser security which prevents me from  referring to a local file location.

Was looking to bypass the security issue by "uploading" the file via a form but diverting it straight into the "localstore" and store previously uploaded images in an array for re use and so that it will work when the user is offline.

Has anyone tried this? Is it possible or are most of the mobile browsers still not there yet?

Thanks.

regards,

H
JavaScriptHTMLAndroid

Avatar of undefined
Last Comment
Amhazing
ASKER CERTIFIED SOLUTION
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Amhazing
Amhazing
Flag of Australia image

ASKER

Interesting idea..

I can't see how it solves the image upload problem though?  Am I missing something?  How would the image stored locally get into the canvas in the first place when the user is offline?

regards,

H

 
Avatar of Michel Plungjan
Michel Plungjan
Flag of Denmark image

since you can render an image as a data url without sending it to the server it should be possible to store the url as a string in the local store until online and then send it to the server later
Avatar of Amhazing
Amhazing
Flag of Australia image

ASKER

Thanks - will give it a try and update..

regards,

H
JavaScript
JavaScript

JavaScript is a dynamic, object-based language commonly used for client-side scripting in web browsers. Recently, server side JavaScript frameworks have also emerged. JavaScript runs on nearly every operating system and in almost every mainstream web browser.

127K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo