Quantcast
Channel: Active questions tagged filereader - Stack Overflow
Browsing latest articles
Browse All 53 View Live

JavaScript FileReader Slice Performance

I am trying to access the first few lines of text files using the FileApi in JavaScript.In order to do so, I slice an arbitrary number of bytes from the beginning of the file and hand the blob over to...

View Article



TypeError: Failed to execute 'readAsText' on 'FileReader': parameter 1 is not...

I'm writing an chrome application with scala.js, and have some file reading problem.When I use chrome.fileSystem.chooseEntry with openDirectory to select a directory, I want to read the _meta_.json...

View Article

Image may be NSFW.
Clik here to view.

after reading a file as text i can't remake a file from it

i have a file a image/png file i need to read it with the FileReader api and then make a file or blob from the text the problem here is when i try to make a file the data seems to be corrupted i tried...

View Article

Image may be NSFW.
Clik here to view.

FileReader losing data when reading PDF

I have the constraint of sending data to a server in JSON format only, and I need to send a PDF file together with other form data in the JSON. I though I could make a string from it with base64 like...

View Article

how to get images to display on the browser using the fileReader() which...

`` imageInput.addEventListener('change', function (event) { const file = event.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function (e) { // Set the image source when...

View Article


Where to put resources and access it in Java Project (in IntelliJ)? How to...

I have text file, which I want to read from, but I don`t really know how to navigate from the class path to the path where the file is.This is my project structure:Project structure...

View Article

Image may be NSFW.
Clik here to view.

Convert Blob to binary string synchronously

I'm trying to put image in clipboard when user copies canvas selection:So I thought the right way would be to convert canvas tu dataURL, dataURL to blob and blob to binary string.Theoretically it...

View Article

Image may be NSFW.
Clik here to view.

How to add folder of property files in eclipse

I shifted my project from tomcat to eclipse. All files are working fine but the folder containing property files are not working.What I did so far:Added folder in project -> buildcreated a source...

View Article


how to mock failure of FileReader

I have a function which creates a FileReader. In that function I also set the load and error event handlershandleFileSelect(files:ArrayLike<File>){... let reader = new FileReader() reader.onload...

View Article


"The requested file could not be read, typically due to permission...

I have an read file functionality that is implemented like:import { Injectable } from '@angular/core';import { Observable } from 'rxjs';import * as Papa from 'papaparse';@Injectable({ providedIn:...

View Article

Strange behavior with FileReader()

EDIT: After searching a lot of websites for an answer, I finally found !I found this site https://codepen.io/Anveio/pen/XzYBzX and I modified (a lot of) my code based on the code and now everything is...

View Article

FileReader() not working with Firefox and gib files

If I upload a large image with e.g. 20 MB, it is not displayed in Firefox, but it works without any problems in other browsers such as Chrome, Brave, Edge or Opera. For smaller images with e.g. 5 MB,...

View Article

Is it possible to cut part of video and upload it on server only with html5 & js

I use Filereader to read local video file (mp4), so I can display it in video tag.I need to cut part of mp4 file (i.e. from 5 to 10 seconds) and upload it on server.My current solution: I upload whole...

View Article


FileScanner does not have the next Line for Txt Files With First Few Lines...

I am trying to use file scanner in Java to read a txt file and populate a linked list with parse information from the file. The file is tab delimited and needs to get the "name" and "console". The file...

View Article

Javascript Reader.readAsBinaryString doesnt work in IE

Can someone help me out! my reader.readAsBinaryString() doesn't work in IE.Now I find some other ways online but I'm not able to get this working.Can someone help me transform my method so it will...

View Article


Convert input=file to byte array

I try to convert a file that i get through an input file into a byte[].I tried with a FileReader, but i must miss something :var bytes = [];var reader = new FileReader();reader.onload = function () {...

View Article

How to read from txt file via filereader and write a modified?

I have to read a txt file via filereader and make a censoring by removing all words starts with "c" and "C" and write it by creating a new txt file as censored. I have done below, but I need to make...

View Article


sending audio file to open ai whisper model

I am converting my recorded audio file to a blob object and then reading it with file reader to make a post request to open ai whisper modelIt expects a audio file and model name i.e whisper-1The error...

View Article

FileReader Image to Base64 Corrupted Conversion

I am trying to convert an image from my local files to Base64 by JavaSctipt. For example please look at this website.When I browse a picture on the input beneath Local File* heading (input having id...

View Article

Image may be NSFW.
Clik here to view.

How can I fetch metadata or file version (properties details section) of a...

I am trying to get dll file version on client side only.Writing code on Angular 16 (2+), any solution on ts/js would work.I tried using DataView and couple of solutions i found online, though they are...

View Article

Issues when Reading Preferences from Input File in Java for Stable Matching...

I'm working on a stable matching problem implementation in Java, where the input is provided via a text file. The problem involves matching a set of men to a set of women based on their...

View Article


Image may be NSFW.
Clik here to view.

How do I extract the Base64 string from a FileReader (NextJs typescript)?

I am receiving an object from the response, and I want to extract the string.const convertFileToBase64 = (file: File): Promise<string> => { return new Promise((resolve, reject) => { const...

View Article


How to split the strings in a file and read them?

I have a file with information in it. It looks like: Michael 19 180 Miami George 25 176 Washington William 43 188 SeattleI want to split the lines and strings and read them. I want it to look like:...

View Article

html5 fileReader -- how to only read the first N characters of a file?

Currently I use a pattern like the following to read the first 3 characters of a series of files:var files = e.dataTransfer.files;for (var i = 0, f; f = files[i]; i++) { var fr = new FileReader();...

View Article

Javascript FileReader onerror event - how to find out what the error was?

the Javascript FileReader object supports an onerror handler that gets called when there has been an error, but the event passed in is a ProgressEvent and doesn't contain any details of the error.How...

View Article


Issue with File Upload using FileReader: "DomException: A requested file or...

I'm encountering an issue with file uploads with FileReader using the provided code snippet. Most of the time, the code works fine without any issues. However, for some users, files are randomly...

View Article

In the java code below which is a method of a larger program my ArrayList is...

public static ArrayList<Vehicle> loadVehicles(String filePath) { ArrayList<Vehicle> vehicles = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new...

View Article

File reader not giving out the results properly for certain csv files

I'm new to file reader. While adding a csv file, the file reader sometimes gives out the results like thisPillar ID,Pillar Name,Question ID,Question,Question Description,Best Practice ID,Best...

View Article

Convert Blob to image url and use in image src to display image

How to convert blob to base64/image? I am getting this blob through API call and I am trying to display it in a image. I have tried with stackoverflow answers but nothing could help so I just tried...

View Article



how can I update a video by new one selected from pc by using input file, in...

I am trying to update the 'src' of video tag by updating state variable. In state variable I am storing the video file which I am selecting from my pc using file input.I have tried it by using...

View Article
Browsing latest articles
Browse All 53 View Live




Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>
<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596344.js" async> </script>