Questions tagged [fileapi]

Use this tag for questions related to the W3C File API. The W3C File API specifies how file objects should be represented and how their properties should be accessed.

The W3C File API at https://w3c.github.io/FileAPI/ specifies how file objects should be represented and how their properties should be accessed.

The File API spec includes the following interfaces:

  • Blob - raw binary data. Blob objects can be created via the Blob() constructor, but their properties are read-only.
  • File - a specific type of Blob with additional read-only properties.
  • FileList - a collection of File objects.
  • FileReader - provides asynchronous access to a content of a Blob or File object.

Related Tags

Resources

532 questions
0
votes
1 answer

Clarification required on Javascript in HTML5 fileAPI for image preview

I was looking at the new HTML5 file API for showing a preview of an image to be uploaded. I googled for some code and almost every example had the same structure, almost the same code. I don't mind copying, particularly when it works, but I need to…
Sunny
  • 9,245
  • 10
  • 49
  • 79
0
votes
2 answers

Reading modification date of file on server

I have a simple website on which I want to display the modification date of a specific file in a text element on the websites body. Below is some code I have but it's meant for multiple files. I am pretty new to this so I cant seem to figure out how…
freshking
  • 1,824
  • 18
  • 31
0
votes
1 answer

using HTML5 File API with elevate zoom jquery plugin

I'm trying to use elevate zoom jquery plugin on an image created with the file api right off the user's computer. However it doesn't seem to work! It's as if elevate zoom doesn't recognize the "src" of the image. Any ideas? Thanks a lot! Here's my…
Eslam A. Hefnawy
  • 37
  • 1
  • 1
  • 7
0
votes
1 answer

Upload multiple images to filesystem

I need to save multiple images to File system. But in the file system only last image is entered. How can i solve this problem? Here is my code: // Loop through each image and to create image blob for(var slide in…
Erma Isabel
  • 2,167
  • 8
  • 34
  • 64
0
votes
2 answers

For loop wait: jquery

for (var i in ids) { alert("image" + i + ".png"); setTimeout(function () { (function () { fs.root.getFile("image" + i + ".png", { create: true }, function (fileEntry) { …
Tinku Chacko
  • 520
  • 1
  • 6
  • 20
0
votes
0 answers

HTml5 File Api : CrossDomain Issue

I am having a cross Domain issue when working with file Api.It works fine when i change the value of variable photoUrl.Here is the code: window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; var xhr = new…
asna
  • 242
  • 1
  • 3
  • 12
0
votes
3 answers

Metadata in Cordova's File API

I'm looping through a directory of files in Cordova 3.1.0. For each entry I want the filename and the modification date. I'm using the getMetadata method on the FileEntry object, which returns the Metadata object in the success callback but I can't…
Dan
  • 479
  • 6
  • 12
0
votes
1 answer

What do .files actually do in JavaScript?

I see people using the .files extension like this: var selectedElement = document.getElementById(id).files[0]; I only know it is part of the DOM. I've tried to search the internet to find a reference about what this does, but I can't find any. Can…
dramasea
  • 3,370
  • 16
  • 49
  • 77
0
votes
1 answer

function(evt) Javascript File API

I'm having a problem with the Javascript File API. First I'm checking if a form input is valued, and if the form input type=file name is image, I want it to get the image: function checkIfValued() { $("form input, textarea").change(function() { …
bhc11
  • 157
  • 1
  • 2
  • 14
0
votes
0 answers

Is it possible to get an "offset" of a string in a file at a reasonably fast speed?

In HTML5, it's easy to slice a (huge) file if I know start byte and end byte: var reader = new FileReader(); var blob = file.slice(start, end); reader.readAsBinaryString(blob); But what if I want to slice a huge text file from String A to String…
lyrically wicked
  • 1,185
  • 12
  • 26
0
votes
1 answer

Uncaught TypeError: Cannot read property 'root' of undefined

I'm trying to implement file api storage for offline capabilities in an html5 web app and I'm running into a few issues. I have the following code in an included JS file (a library I'm creating for working with file api): window.requestFileSystem =…
djm61
  • 464
  • 1
  • 8
  • 23
0
votes
1 answer

Html 5 file api & jcrop issue

I render a picture in local using html5 and File API. html:

Giu
  • 1,832
  • 2
  • 16
  • 31
0
votes
1 answer

how to maintain indentation when showing file with html5 file api?

I am trying to some simple text files with HTML5 file api like css,js,etc. but I lost indentation when displaying . how could I get indentation?
user1834809
  • 1,311
  • 4
  • 17
  • 28
0
votes
2 answers

Read file/image from local drive in javascript

Just wanted to know is it possible to access/read a given file(if full filepath is enabled) using Javascript in HTML or any other technique. I am quite new in HTML 5. Thanks in advance Thanks Vinod
vinod8812
  • 645
  • 10
  • 27
0
votes
1 answer

How to get a standard JavaScript File API object using the Windows.Storage FileOpenPicker class?

While working on a Windows 8 app, I noticed that I can open and get a reference to a File object using something like: // Markup // JavaScript var fInput = document.getElementById('myFile'); fInput.onchange =…
lostsource
  • 21,070
  • 8
  • 66
  • 88