Questions tagged [fileapi]

1

votes
0

answer
31

Views

Unable to write the base64 encoded string to the file

Hi I am facing a big issue while sending data from Angular 4 i have the following base64 encoded string data:text/plain;base64,SEkNCndlbGNvbWUgdG8gQW5ndWxhciEh while writing it to the file getting the following output u뚵쭾隊vڱI welcome to Angular!! but it should display the following conte...
Santhosh
1

votes
1

answer
95

Views

Upload image file size is more than actual file size

I am uploading an image in c# using a fileapi plugin. My actual file size is 60kb but after uploading the file size appears as 350kb on the server. Why is this happening? Here is my code for saving an image: public JsonResult SaveImageFile(byte[] file) { var filesData = Request.Files[0]; string file...
Ammar Muhi ud din
1

votes
0

answer
225

Views

Angular 5 File upload in chunks to ASP NET returns with Unexpected end of MIME multipart stream. MIME multipart message is not complete

So, I am trying to upload big files in chunks using Angular 5 and the fileapi This is how my request looks like: const formData: FormData = new FormData(); formData.append('fileKey', this.fileToUpload, this.fileToUpload.name); FileAPI.upload({ url: 'http://localhost:22166/api/lbx/upload', headers: {...
Luis Lavieri
1

votes
2

answer
609

Views

Is there a way to unload a file which has been loaded into memory from the File API's FileReader.readAsDataURL method in javascript?

I am writing a javascript application using the File API in Google Chrome. I am loading the files with the readDataAsURL method. I only need one file loaded at a time. So, each time I load a file, it gets added to memory and after a short while, the one tab will be maxing out my memory. Is there...
1

votes
1

answer
1.5k

Views

How to POST a file (from File API) from drag and drop

I have a file-upload page where the file is selected via drag and drop. Because the file is dropped in (rather than using a traditional field), I have the file exposed to me through the javascript File API. I've been reading this article from Mozilla, but I am not all that interested in asynchronou...
Josh Hunt
1

votes
1

answer
761

Views

Handling multiple files with HTML5

I feel a little silly posting this, as it seems pretty straight forward from what I've been reading, but I don't know why I'm always seeing 1 as the value for files.length. $(document).ready(function() { var button = $('#button'); button.click(function(){ var files = $('#files'); alert(files.le...
user1281426
1

votes
1

answer
980

Views

HTML5 check Image Dimensions

I am trying to show the image dimensions with other properties using the HTML5 file API For some reason I am getting height of my image as 0. http://jsfiddle.net/NfDMh/3/ ​ function handleFileSelect(evt) { var files = evt.target.files; var output = []; var height; var width; for (var i = 0, f; f...
Sabby62
1

votes
1

answer
2.7k

Views

Use readAsBinaryString() without an event listener

Hello I'm making my first project with the File API on javascript, is a simple program that takes a file as an input and show the inner code of it on a Div. I want to know if there is a way to get this code working without an event listener and event handler. I think this is the main problem but I c...
Andres
1

votes
1

answer
196

Views

How is that jQuery-File-Upload plugin works without Flash or Silverlight?

The jQuery-File-Upload claims to work with IE6+ and there are no open issues about it at https://github.com/blueimp/jQuery-File-Upload So I am wondering how it accomplishes this when other polyfils to the file API have needed add-ons to access the file system.
getsetbro
1

votes
1

answer
616

Views

PHP & Jquery FileAPI - shared PHP server configuration

I'm letting my users crop & upload their image with jQuery FileAPI. I'm calling this PHP file with jQuery from another page. Everything works good on my local server, but when uploading it to my production (shared - cPanel) server, it does not create the file. Do you know if there is something that...
Sir Code-A-lot
1

votes
2

answer
744

Views

PhoneGap File API issue while saving image captured on a directory

I have following code to store the image in a directory 'myApp' on S4 function gotFileEntry(fileEntry){ var gotFileSystem = function(fileSystem) { alert('got file Sys: ' + fileSystem.name); fileSystem.root.getDirectory('myApp', { create : true }, function(dataDir) { alert('got dir :' + dataDir.fu...
user1614808
1

votes
1

answer
1.6k

Views

File API Not Working in Safari

I am testing three different browsers, chrome, firefox and safari. if (window.File && window.FileReader && window.FileList && window.Blob) { //check whether browser fully supports all File API } It returns true for chrome and firefox.. but it does not return true for safari. Does safari support Fi...
Juni Brosas
1

votes
1

answer
257

Views

Upload swf and get width and height using HTML5 File API

What is the best way to read width and height of an uploaded swf file using HTML5 File API? The best tip I have found in my research was to get url from window.URL.createObjectURL(file) in order to pass it to the src attribute of a dynamically created embed element. Then obtain width and height. Do...
Pawel Furmaniak
1

votes
1

answer
54

Views

drag file to browser from local

I want drop jpg to Browser from local, and display it on Browser. I write code, but it don't display jpg. Please advice. html css .droppable { width:500px; height:500px; background-color: gray; } script function doDragOver(event){ var type = event.dataTransfer.types.contains('Files'); if (type){ ev...
hucuhy
1

votes
1

answer
580

Views

Fine uploader Async task works in Chrome but not in IE11

I use Fineuploader Promise to run md5 check in submit callback to prevent the files already exist upload again,it works in chrome but not in IE11. is't a IE bug or i do it wrong?how can I fix it? Thanks a lot. here is the script: $('#uploader').fineUploader({ request: { endpoint: 'home/upload' }, mu...
user3657690
1

votes
2

answer
1.2k

Views

HTML5 File API Upload Multiple Images with Ajax

I am trying to upload multiple images with File API. I want to show picture thumbnails and their names as title tag. The problem is I am not getting correct picture name as title tag. All pictures are showing same name. Here is my Original code... jQuery, CSS and HTML var output = document.getEleme...
Code Poet
1

votes
1

answer
97

Views

html5 file api, storing user selected directory in sessionStorage?

I'd like to make an application where a user can select a directory on their own computer, and I can refer to the images in that directory across page refreshes/etc. For example, the user selects a directory, or just multiple image files, and then every time the page is refreshed, display a random...
Michael Podrybau
1

votes
1

answer
87

Views

Modifications on files are not displayed until application restart (File API)

I am building a basic Ios application using PhoneGap and the File API to download and update XML files. The download part is done with Ajax calls and the update is done with FileEntry objects. Here what it looks like : $.ajax({ type: 'GET', url: 'https://site/folder/GetFluxXmlServlet', dataType: 'te...
Superslinky
1

votes
1

answer
947

Views

Jquery FileApi returing open is not a function

I am using FileApi (See Userpic + crop Demo ) to Crop Image Before upload. but as soon as i select image file from computer, I got a error $(...).modal(...).open is not a function JS: $(document).ready(function () { $('#userpic').fileapi({ url: '@Url.Action('upl','Home')', accept: 'image/*', imageS...
Amit Kumar
1

votes
1

answer
157

Views

Is it possible to read file system from sd card in browser using javascript

I am creating a media player in html/js which will read and display audio/video present on sd card with file structure. I can read single/multiple files with File Api but an't find anything to read complete directory. Is it possible?
Scroll-lock
0

votes
1

answer
15

Views

Create File or Blob from local path in Javascript

I have extensively and systematically searched for an answer in stack overflow but haven't been able to find one that fits my needs. I am trying to upload a number of files to Firebase Storage, which requires a File or Blob object. var file = ... // use the Blob or File API ref.put(file).then(funct...
Jacobo Koenig
1

votes
1

answer
44

Views

How to unify retrieving file slices, supporting both File API and XMLHttpRequest/Fetch API?

I have a file format that I can parse with JavaScript by reading out slices of it. My data file is very big so I don't want to read the whole file but only slices of it. This is solved by having a header in the beginning of the file that contains an index of the data. I've already written a web page...
Erik Sjölund
1

votes
2

answer
0

Views

Is it possible for us to download a file to a sandboxed location using File API available in HTML 5?

I wanted to ensure the documents I let user download are programmatically manipulated throughout program. I came to know that File API does give Apps the opportunity to manipulate them. But how can we store the Files in the sandboxed location?
Krishnan
1

votes
2

answer
1.5k

Views

Creating file in sandboxed FileSystem on Chrome error

Trying to create a file using the sandboxed FileSystem API: window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem; window.requestFileSystem( window.PERSISTENT, 1024 * 1024, function( fs ) { fs.root.getFile( 'test.txt', {create: true}, function( fe ) { a...
Igor Semenov
1

votes
1

answer
2.7k

Views

Displaying the content of a file with jQuery and HTML5 file API

I am trying to use the HTML5 file API and jQuery to show the content of a file, but it is not working. I am really new to jQuery, so the problem is probably with my code. Here is the code I'm using: if (window.File && window.FileReader && window.FileList && window.Blob) { alert('Si esta soportado el...
Andrés
1

votes
3

answer
13.3k

Views

SCRIPT5007: Unable to get value of the property '0': object is null or undefined

I ran this code through Chrome and Firefox and it works well. Whenever I run it through Internet Explorer for testing purposes it will not work. I checked the javascript consule and I'm getting: SCRIPT5007: Unable to get value of the property '0': object is null or undefined. Can someone please tell...
1

votes
2

answer
2k

Views

Read file/image from local drive in javascript [closed]

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
1

votes
2

answer
4.2k

Views

ReadAsDataURL() doesn't work

I was trying to implement a Drag n' Drop feature in my website. I need to convert the dropped image into Data URI so I can use it with JCrop and upload it after. drop: function (e) { e = e || window.event; e.preventDefault(); e = e.originalEvent || e; var files = (e.files || e.dataTransfe...
Duncan
1

votes
1

answer
531

Views

Fineuploader: Process a file before uploading

I need to process binary data of every file that is uploaded to Amazon S3 through (with and without chunking). Do you know if there is any function/signal in Fineuploader that I could use to process every binary chunk/file ?: For example: preupload(data_chunk) process(data_chunk); return data_chunk...
1

votes
1

answer
88

Views

Alter file contents before uploading

I would like to encrypt the contents of a file before uploading to our server .. we are using fineuploader. What I would like to do is: function onSubmitted(id) { var file = uploader.getFile(id); var reader = new FileReader(); reader.onload = function (e) { //encrypt here // but how do I save the fi...
Craig Bruce
1

votes
1

answer
100

Views

How to manipulate filestream in memory before uploading

I'm working on an uploader that needs to censor a few bytes in the uploaded data by overwriting them to a predetermined value, before uploading them. Right now, I've hooked into the onSubmit event because it allows for non-blocking work to be performed. Below you can see my event handler. Just befor...
Korijn
1

votes
2

answer
193

Views

What order are files added to the DataTransfer FileList when dragging and dropping files in javascript?

I'm building a web application where users drag images into the browser and drop them to upload them. The problem is, I would like the files to upload in the same order as the folder they dragged them from. It seems like the files in the ondrop event's DragEvent.DataTransfer.FileList are sequenced r...
Drucifer
4

votes
1

answer
140

Views

How to send JSON object with ArrayBuffer to websocket?

I'm trying to simply upload a file to a node.js server. To do this, I'm using the file API and readAsArrayBuffer. Here's the code that's called when the input file 'change' event is fired, along with some hepler functions (and I'm using the COBY library for socket sending and other event setup, the...
Yaakov5777
1

votes
2

answer
196

Views

File API - reader.onload is never triggered?

I have multiple file inputs and want to generate preview of uploaded files for each input. I'm waiting for change on all of these inputs and then I trigger new FileReader(). Unfortunately the onload action is never triggered, what am I doing wrong? $('body').on('change', '.file', function(event){ s...
Wordpressor
1

votes
2

answer
175

Views

base 64 encode a form file

I'm writing a very simple file sharing site in JS and PHP. I've got a drag/drop working, so the browser gets a file object upon drop, and from there I tried to send in a xhr request to an upload page. However, I can't seem to just drop a binary file object in a request header, and so was wondering h...
tekknolagi
1

votes
2

answer
11.6k

Views

HTML5 and Javascript : Opening and Reading a Local File with File API

I am using Google Web Toolkit for a project and would like the user to select a text file to open in a text window inside the browser. Here's the almost working code: private DialogBox createUploadBox() { final DialogBox uploadBox = new DialogBox(); VerticalPanel vpanel = new VerticalPanel(); Strin...
holocron
1

votes
2

answer
3.8k

Views

Add class in drop area (file input) when dragging an external image over (dragenter) in Vue.js

I've built a simple Drag & Drop image preview over the file input in Vue. It's works fine but when the image is dragged over the dropzone I want to add a class so it will highlight the area, which it already does when you hover over it. HTML: Drop image here or click to select {{ help }} Remove Java...
Jack Barham
1

votes
1

answer
805

Views

How to distinguish folders and files drag and drop Ajax upload in FireFox

I can not find the way to distinguish between folders and files drop in FireFox Ajax. Looks like there are no signs in FireFox FileAPI that can tell if this is a folder or a file. However I see that Google docs somehow can distinguish between folders and files drop. It does not relie on extensions...
IT Hit WebDAV
1

votes
1

answer
3.9k

Views

Cordova iOS File API - Move Photo to a persistent storage

I've a problem with moving a camera photo to the persistent storage under iOS 7 (Cordova 3.4.0-0.1.3 - File API 1.0.1). I can capture the photo and when I move the file to the persistent storage it seems that there is no error, I also receive a file path with new_entry.fullPath like /my_folder/12345...
Pascal Bajorat
1

votes
1

answer
940

Views

Accessing partial results of a FileReader in Firefox

I want to use a FileReader in my web application to partially load a CSV file into the browser. However, I am not able to access partial results in Firefox 27. My application requires only the first 100k bytes of the CSV file to populate a data preview. Therefore, I setup, start, and then abort the...
Juve

View additional questions