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
12
votes
1 answer

window.resolveLocalFileSystemURL vs window.requestFileSystem

What is the difference in using window.resolveLocalFileSystemURL vs window.requestFileSystem when downloading files with the cordova file plugin? I cant find any documentation on resolveLocalFileSystemURL but it works fine, and its easier to…
tobbe
  • 1,737
  • 6
  • 23
  • 40
12
votes
1 answer

What is the max number of files to select in an HTML5 [multiple] file input?

I have 64000 small images I want to upload to my website (using existing validation, so no FTP etc). I've created an HTML5 [multiple] type=file input for this a while back to be used for a hundred or hundreds of images. Hundreds is not a problem.…
Rudie
  • 52,220
  • 42
  • 131
  • 173
11
votes
2 answers

How to decode a JPEG2000 bitarray image with JavaScript

I'm using the File API to break down a DICOM file and get its data in a byte array. The problem is that I can not decode a JPEG2000 image and show it in the browser (Chrome, Firefox, etc.). For example, if the image data is coded in JPEG format, I…
user1211709
  • 139
  • 1
  • 3
  • 6
11
votes
4 answers

file input size issue in safari for multiple file selection

I am experiencing inconsistencies with regard to multiple file upload in Safari 5.1 on Windows Vista (haven't tried other platforms). The input element has the multiple flag to allow selection of multiple files. The problem occurs when the user…
rewolf
  • 5,561
  • 4
  • 40
  • 51
11
votes
1 answer

Chrome memory issue - File API + AngularJS

I have a web app that needs to upload large files to Azure BLOB storage. My solution uses HTML5 File API to slice into chunks which are then put as blob blocks, the IDs of the blocks are stored in an array and then the blocks are committed as a…
WillH
  • 2,086
  • 6
  • 23
  • 40
11
votes
2 answers

Angular 2 download .CSV file click event with authentication

I'm using a spring boot backend and my api uses a service to send data via an OutputStreamWriter. I can download this in Angular 2 using a click event like so: Typescript results(){ window.location.href='myapicall'; } HTML
Bhetzie
  • 2,852
  • 10
  • 32
  • 43
11
votes
3 answers

How FileReader.readAsText in HTML5 File API works?

I wrote the following code to check whether the uploaded file exists or not using HTML5 file API.

The following JavaScript…
sushmithaP
  • 133
  • 1
  • 3
  • 12
11
votes
1 answer

HTML5 and Amazon S3 Multi-Part uploads

Is it possible to use the HTML 5 File API (for example, this library: https://github.com/23/resumable.js ) in conjunction with the S3 multi-part upload feature? http://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html
sleepy_keita
  • 1,488
  • 4
  • 17
  • 26
11
votes
1 answer

Javascript can you serialize a File object

I need to serialize a File object from a file input, so that the object can be saved, parsed back to a file object, and then read using the FileReader object. Does anyone know if this is possible in Google Chrome? I think the problem lies in the…
Jesse Kinsman
  • 732
  • 2
  • 7
  • 20
10
votes
3 answers

JS and type.match as file mime type - need advice

Today I faced an interesting thing as FF File API and separate files by their types. OK here is a little snippet as if (!input.files[0].type.match('image.*')) { window.alert("Select image please"); return; } it…
user592704
  • 3,674
  • 11
  • 70
  • 107
10
votes
2 answers

Resumable uploads using HTML5 File Upload API -

I want to implement resumable uploads with Html5, and everything seems to work, except identifying that the file to be uploaded is the same one already partially uploaded. Ideally, I would have some client side hashing of the file that generates…
Yuval
  • 101
  • 1
  • 5
10
votes
1 answer

HTML5 File API crashes Chrome when using readAsDataURL to load a selected image

Here's my sample code: var input = document.createElement('input'); input.type = 'file'; document.body.appendChild(input); input.addEventListener('change', function(){ var file = input.files[0]; var reader = new FileReader(); …
ummwolfcat
  • 101
  • 1
  • 4
10
votes
2 answers

Can you write files in Chrome 8?

I'm wondering if, with the new File API exposed in Chrome (I'm not concerned with cross-browser support at this time), it would be possible to write back to files opened via a file input. You can see an example of what I'm trying to accomplish here:…
gregghz
  • 3,925
  • 7
  • 40
  • 69
10
votes
5 answers

"undefined" returned when accessing some listed properties of File object

I can't seem to access the width or height keys of my object. I'm using dropzone.js which has an event for addedFile which returns the file and the first param. so: var myDropzone = new Dropzone('#dropzone', {url: '/'}); myDropzone.on('addedFile',…
Shannon Hochkins
  • 11,763
  • 15
  • 62
  • 95