Click here to Skip to main content
15,884,794 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
And to be clear: I am not trying to access the filesystem without the users knowledge! The user will provide a file (probably via drag and drop), the script will transform the file in memory, and the user will be prompted to download the result. All of which should be "safe" activities as far as the browser is concerned.

What I have tried:

Making a very simple input html page
Posted
Updated 9-Feb-21 7:44am
v2
Comments
20212a 9-Feb-21 13:19pm    
I don't think javascript can manipulate a file.
CHill60 9-Feb-21 13:25pm    
Use the FileSystemObject
20212a 9-Feb-21 13:37pm    
That's not JavaScript is it?

1 solution

Try this CP article as a starting point File Handling at Client Side Using Javascript[^]

[EDIT] A more modern approach is documented here - Using files from web applications - Web APIs | MDN[^]
 
Share this answer
 
v2
Comments
20212a 9-Feb-21 13:38pm    
That uses ActiveXObject which is only supported in IE, and I'm not even sure IE is supported anymore.
CHill60 9-Feb-21 13:58pm    
IE due to retire August this year. IE mode can be supported in Chromium based Edge. There are also some (awful) work-arounds for other browsers. Nevertheless I have updated my solution with a more modern approach as question is explicitly tagged HTML5. OP appears to be a spammer anyway
20212a 9-Feb-21 14:00pm    
Ya, looks like they might be trying to gain points.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900