fileapi

Large file upload with WebSocket

。_饼干妹妹 提交于 2019-12-28 03:30:47
问题 I'm trying to upload large files (at least 500MB, preferably up to a few GB) using the WebSocket API. The problem is that I can't figure out how to write "send this slice of the file, release the resources used then repeat". I was hoping I could avoid using something like Flash/Silverlight for this. Currently, I'm working with something along the lines of: function FileSlicer(file) { // randomly picked 1MB slices, // I don't think this size is important for this experiment this.sliceSize =

HTML5 File API downloading file from server and saving it in sandbox

假如想象 提交于 2019-12-28 03:19:06
问题 I'm trying to understand HTML5 API. I'm designing the web application where the browser client need to download multiple files from server; user will perform something with the downloaded files and the application than need to save the state on user hard-rive. I understand that the browser can save these files only to its sandbox which is fine as long as the user can retrieve those files on the second time he starts the application. Should I use BlobBuilder or FileSaver? I'm a bit lost here.

opening any arbitrary file on disk using HTML File API

杀马特。学长 韩版系。学妹 提交于 2019-12-25 18:42:56
问题 Is this possible to programmatically open any file on disk using HTML5 File API, for example adding at first those paremeters? open -a Chromium --args --allow-file-access-from-files --disable-web-security 回答1: First you have to open Chrome using the flag --allow-file-access-from-files Make sure all your chrome windows are closed before opening it with the flag. Then with javascript you have to use the XMLHttpRequest object. Something like this: xmlhttp = new XMLHttpRequest(); xmlhttp.open(

decode & play a song using html5 file api

僤鯓⒐⒋嵵緔 提交于 2019-12-25 03:26:25
问题 i have been trying to learn the file api for the first time.Here i want to play a song .But no sound is generating .I tried to use readAsArrayBuffer() method as i found it is used to decode audio files.But unfortunately nothing happened.how this can it be solved.thanks :) <html> <head> <style> #files{ display:none; } #lab{ display:inline-block; width:70px; height:30px; background:lime; padding:5px; } #lab:hover{ cursor:pointer; } p{border:1px solid black;} </style> </head> <body> <form>

Pass submited file to web worker by refference with as little overhead as possible

走远了吗. 提交于 2019-12-23 12:39:07
问题 I will have a web worker to parse huge text file (200000 lines, simple syntax though). I expect user to submit that file wia drag'n'drop or otherwise, obtaining a File object: var work = new Worker("parser.js") document.addEventListener("drop", function(e) { e.preventDefault(); var dt = e.dataTransfer; var files = dt.files; if(files.length>0) { var firstFile = files[0] var reader = new FileReader(); //SEND FILE TO WORKER? } }); I heard of Transferable objects. Is there a way to transfer file

What is the purpose of webkitRelativePath property in File object?

三世轮回 提交于 2019-12-23 07:07:19
问题 If you printout File object in Chrome console with something simple like this: <input type="file" onchange="console.info(this.files);" /> you will see among other properties an always empty webkitRelativePath property: fileName: "07.png" fileSize: 33022 lastModifiedDate: Date name: "07.png" size: 33022 type: "image/png" webkitRelativePath: "" __proto__: File What is it's purpose? And how it can be leveraged? 回答1: It's populated when using the webkitdirectory attribute on the file input:

how to Preview the video file that user wants to upload on the website (PHP, FiileAPI JS)

北城以北 提交于 2019-12-22 10:34:01
问题 I mean, when a user chooses the video file from their system, have the web-page already show them the files they want to upload. I'm already using image file to preview using FileAPI JS. The same I want to do with FileAPI JS for video file. (So, It must be work within my client side) Thanks & answers are appreciated :) 回答1: You can either use FileReader or createObjectURL. They'll both get the job done, but FileReader has slightly broader support in browsers. createObjectURL will run

Maximum files of a directory that can be read by FileReader#readEntries in JavaScript

左心房为你撑大大i 提交于 2019-12-22 06:27:06
问题 I'm creating a Chrome application. I must read the files of a directory and I am using the DirectoryEntry API and DirectoryReader API. My problem is that the maximum files read using DirectoryReader#readEntries is 100, the first 100 (alphabetical order) var reader = currentDir.createReader(); var read = reader.readEntries.bind(reader, function(files) { for ( var i = 0; i < files.length; i++){ if (files[i].name == nameSearches){ callback(files[i]); } } }) callback(undefined) } read(); The

Is there a Javascript support library for html5 file API and upload?

北战南征 提交于 2019-12-21 11:09:10
问题 until now I was using flash based swfupload and its swfupload.js which provides users with callbacks from flash and a possibility to set it up. I was wondering if there is anything like this for HTML5 File API. I'm asking before I make it from scratch myself. I don't want to reinvent a wheel when there might be a good library out there already. 回答1: I've played with this in the past: http://aquantum-demo.appspot.com/file-upload Seemed reasonable for what I was doing. 回答2: I use valums file

Understanding Object URLS for client-side files and how to free the memory

天大地大妈咪最大 提交于 2019-12-21 05:17:15
问题 I am using createObjectURL to get a reference URL to a local image file. When I am done with the file/image, I call revokeObjectURL to free that memory. Everything works fine for me but I just want to be sure that I am releasing all the memory I can. My concern arose after I inspected the chrome://blob-internals page. Upon calling createObjectURL and using the image, I noticed two entries were created. One with url blob:blobinternal:///d17c4eef-28e7-42bd-bafa-78d5cb86e761 and the other blob