How to get the file absolute path using javascript or ...? [duplicate] - javascript

This question already has answers here:
how to get client side path of the uploded file
(2 answers)
Closed 9 years ago.
I have a javascript that used to upload files.
The problem is I can't get the absolute path using javascript. Is there any other client-side scripting language that can be used to get the absolute path of the file and pass it to my javascript? I don't want to used server-side scripting language like php. Is this possible?
Just to get the path is fine..

You can't get the file path in client browsers. For security concern it is restricted. You will be given only the fake path is shown with file name.

Related

How to call exe on server from javascript? [duplicate]

This question already has answers here:
Launch local executable from web browser
(2 answers)
Closed 6 months ago.
Javascript is inaccurate, but I need a very precise answers to a quartic equation. I want to slove it with c++, that i compiled into an exe file and will update the answers in a javascript file that I include in the HTML. I need to run the exe file that is in the same folder as the .html file on the server, and pass 5 parameters to it. It will update the javascript file, but I have no idea how to run that exe file. Can anyone help me?
----EDIT----
Thanks #Quentin webassembly worked!
You can't. That would be a severe security vulnerability, if any random web page could execute any random file on your computer.
So, web pages can't execute files on your computer.

Is it possible to possible update registry values using a client side programming language [duplicate]

This question already has answers here:
How to change registry settings on a system through web browser
(4 answers)
Closed 5 years ago.
I am new to penetration testing. My requirement is to update registry values from browser using a client side programming language like javascript. Is it possible?
No, JavaScript can't read / write arbitrary files to the hard disk, copy them or call programs. It does not have direct access to the operating system.
This is done for the security of users, so that an attacker could not use JavaScript to obtain personal data or somehow damage the user's computer.

Javascript load each file in folder [duplicate]

This question already has answers here:
How to read files from folder
(2 answers)
How to print all the txt files inside a folder using java script
(2 answers)
How to upload and list directories at firefox and chrome/chromium using change and drop events
(1 answer)
Closed 5 years ago.
In my project I have got a folder with .csv files. I dont know how much - it could be 1, 0 or even 50. How can I load all of them with javascript or with some javascript plugin?
Best way of doing so would be to use the fs module of NodeJS. You can read a file by using fs.readFile() and write to a file by using fs.writeFile().

How to download .exe file from server at a predefined location using window.open method or xmlhttprequest onject? [duplicate]

This question already has answers here:
How to download file in computer silently using PHP? [closed]
(3 answers)
Closed 10 years ago.
My problem is that i want to read an .exe file from server and save it to a predefined location. Currently I am using window.open method but it is opening a window and asking for the path. please tell me if know any such method and javascript or GWT is preferable.
Then I also tried to attach progress event with xmlhttprequest object which could tell me whether downloading is done or not but it is also not working fine and desired output is not coming.
Please help me with these two problems.
Hop to get a reply soon. Thanks in advance!!!
You can't save to a predefined location due to security implications.

can we rename/write to local files in HTML5 [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Modifying Local Files Using HTML5 and JavaScript
I know we can read a local file that has been selected by the user, but is there the ability to rename or write to local files in javascript?
There is no way to natively write the filesystem in Javascript, for obvious security reasons.
However, if you must, there is an ActiveX object (Only in IE). It's Scripting.FileSystemObject.
You will find the documentation about that beast on the msdn site.

Categories