On http://www.html5rocks.com/en/tutorials/file/dndfiles/ it says:
As example of its capabilities, the File API could be used to create a thumbnail preview of images as they're being sent to the server, or allow an app to save a file reference while the user is offline.
I cannot find any information about how it works to save a file reference while the user is offline. Is there a possibility to solve this problem? Where can I find information about it?
Related
I've been using html File API to create files from data received over the internet. So far its been fine.
Once the file is created in the temporary file system of a users browser, the user should be able to download the file. I am not able to achieve this. The files are quite large, larger than the size memory (RAM). So I can't just add a link and create an object url.
I want to make a local file editor. To open some files edit them and save them back. It's ok if it only works in Chrome. Using
<input type="file" id="filepicker" name="fileList" webkitdirectory multiple />
I can read all the files and draw the file tree but I want to also be able to edit and save to these files. Even create new files and folders.
Is there any way to do it. I'm also ok with hacks that use Java or Flash or simply any other hack if HTML5 does not offer any solution.
Thanks
I do not believe what you are suggesting is possible; however, there is a different approach that should solve your problem.
If you take Microsoft's Online Word for example... They have it setup so you save document to the cloud and then can edit them with an online copy of Microsoft Word.
In otherwords, the user would upload a file. Your server would then take the file, display it and allow the user to edit the file. The user would then save the changes to the file. You can then provide an option to re-download the file.
To more closely emulate editing a file on the local file system, you can also setup a "temporarily" save on the server.
Essentially, the user uploads a file. The server would allow the user to view and edit the file. When the user wishes to save it, instead of saving the file on the server, give it back as a download to the user.
After the user leaves your site you can delete the copy of the file that is saved on your server.
As the title indicates i want to have a certain application get access to the local file system. To describe why i will illustrate my situation:
I am a running a IIS WebApplication with the C# MVC 4 Framework as backend module. The site solely consists of HTML, CSS markup and some JS. The page will be loaded in IE11+ (Edge) only. For the standard procedure of displaying and accessing data from as well as sending data to the server this works quite fine.
On a certain page I want the user to be able to upload a file using a simple file dialog, like the one you can initiate with a simple <input type="file"> tag. I also want to offer the posibility to download files from the server but need to know where files has been saved / will be saved to.
As described on a lot of different websites, just like this one here, the HTML5 File API does a great job but will not be able to return the full qualified filename including the local path directions, same for JS accessing the file object.
As my research confirmed HTML5, JS and also SWF (Flash) will not report detailed information because they are all sandboxed applications or restricted by RFCs. I already unterstood and appreciate the effort to secure my trips to internet.
But in this case do need the paths where a file was upload from and the file has been downloaded to.
So my question is, what is the best way to expose the full path directions for a up- as well as downloaded file to report them back to the server?
Is it possible to embed a SWF object inside HTML which will run inside an Adobe AIR sandbox or is a signed JAVA Applet still the one and only solution to accomblish this security breaking task?
A solution i would also apreciate would be the possiblity to ask the user to get access the file system, like you grant access to the web push service to receive notifications.
Also if there is a possible solution which may suite my circumstances please let me know by adding some simeple examples / revealing some factful links, thanks in advance.
I am creating a html5 and javascript web page that allows you to draw your own picture. The page itself works, but I want to make it so my web application will create a folder in their Appdata (or Application Data if they're on a mac) directory.
Then I also want to make it so when a user logs back on to the website, all of their work is saved and they can pick up where they left off.
So basically, I want to be able to create a file on a client's directory, then be able to download that file once they have saved a change to their drawing. Is there a way I can do this? Thanks.
All of these things can be done by using the HTML5 file APIs.
Here are some links which will help you with your task:
http://www.html5rocks.com/en/tutorials/file/dndfiles/
http://www.html5rocks.com/en/features/file_access
Storing state can be accomplished by using one of the following technologies:
Cookies
localStorage
indexeddb
WebSQL
Is there a way how to programmaticly download the file from the server (user clicks save button in the web app) and the browser(supporting File API) or device will download the file and save it in its sand-boxed file system? I'm looking at the HTML5 File API. I can create or amend the file and store it, but first I need to get the file from server. Simply said I want to avoid the save as pop up window and I want the file stay within sandboxed file system of web application.
Any suggestions where I can look is welcomed.
You want XMLHttpRequest(), which despite its name, can handle downloading all types of data including binary. If you set the responseType to "arraybuffer", you can convert that to a blob and save it to the file system pretty easily.
HTML5Rocks has a great tutorial that should cover everything you need:
New Tricks in XMLHttpRequest
(I know this question is a bit old, but I was just searching for how to do the same thing and it was the first result that popped up, so I thought I'd share)
The simplest way to download a file is simply to window.open the URL to it. This will prompt the user to pick somewhere to save the file.
Other than that, there's not a ton you can do; browsers protect their users' file systems very carefully.