Reading a file in local drive using Java script
-
Hi, Need to create a program using Javascript to read the binary file located in the PC(C or D drive) and copy the file contents to a variable in Java Script and send the file data to server. Can this be done without using Active X contols? Am using 'file' input type in HTML 1.0 for getting the path of the file.
-
Hi, Need to create a program using Javascript to read the binary file located in the PC(C or D drive) and copy the file contents to a variable in Java Script and send the file data to server. Can this be done without using Active X contols? Am using 'file' input type in HTML 1.0 for getting the path of the file.
No, you cannot do that just using Javascript from a browser.
-
No, you cannot do that just using Javascript from a browser.
-
-
-
Hi, Using file input type we can only browse the file, my requirement is 1)Browse the binary file 2)Read the contents of the file 3)store the file contents 4)send the stored file contents to server.
Using
<input type="file">
, the contents of the file is loaded by the browser and sent to the server when you submit the form. If you want to send the file without submitting the form, you will have to use Flash, or ActiveX, or something similar. -
Using
<input type="file">
, the contents of the file is loaded by the browser and sent to the server when you submit the form. If you want to send the file without submitting the form, you will have to use Flash, or ActiveX, or something similar. -
Using
<input type="file">
, the contents of the file is loaded by the browser and sent to the server when you submit the form. If you want to send the file without submitting the form, you will have to use Flash, or ActiveX, or something similar.Server side code is in CSP. Upon using submit button, HttpMethod_Post is called. In HttpMethod_Post function fopen will not work as path is in local PC and server is in the device How to copy the data or send the data to server in the device?? Can you please provide code or link.
-
Server side code is in CSP. Upon using submit button, HttpMethod_Post is called. In HttpMethod_Post function fopen will not work as path is in local PC and server is in the device How to copy the data or send the data to server in the device?? Can you please provide code or link.
Sorry, I don't know anything about CSP - a quick Google found me this though: http://barracudaserver.com/ba/doc/en/C/reference/html/structHttpUpload.html[^]
-
No, you cannot do that just using Javascript from a browser.
Graham Breach wrote:
No, you cannot do that just using Javascript from a browser.
Actually... You used to not be able to do it with a browser (was viewed as a security hole). However, with HTML5, browsers have started putting in functionality to trap the filestream when a user selects a file in the input box. More details are here: http://www.html5rocks.com/en/tutorials/file/dndfiles/[^] Personally, I still view it as a security problem because I remember all of the details from back in the day, but my opinions don't seem to be falling in line with the new generation of web folks. (yea, yea, get off my lawn and all that) :)
-
Graham Breach wrote:
No, you cannot do that just using Javascript from a browser.
Actually... You used to not be able to do it with a browser (was viewed as a security hole). However, with HTML5, browsers have started putting in functionality to trap the filestream when a user selects a file in the input box. More details are here: http://www.html5rocks.com/en/tutorials/file/dndfiles/[^] Personally, I still view it as a security problem because I remember all of the details from back in the day, but my opinions don't seem to be falling in line with the new generation of web folks. (yea, yea, get off my lawn and all that) :)
Interesting stuff - thanks for the link. I always thought the file upload support was a bit too limited to be honest. As long as the user still has to choose which files the browser can access this looks like a big improvement.
-
Interesting stuff - thanks for the link. I always thought the file upload support was a bit too limited to be honest. As long as the user still has to choose which files the browser can access this looks like a big improvement.
I do welcome the drag and drop features (this is probably the most common request I used to have when doing web stuff). However, I don't like the idea of implicitly agreeing to local file access by just selecting something in a file input field. Especially since Firefox forces you into the file dialog when you focus on the field, and you cannot delete the input field's contents after selecting a file.
-
Sorry, I don't know anything about CSP - a quick Google found me this though: http://barracudaserver.com/ba/doc/en/C/reference/html/structHttpUpload.html[^]
Hi, How to get data when When we use on the webpage we get the option to select the file to be read. Upon submitting we get the data right but how to copy the recieved data or send to server?? The control goes to below code upon submitting. if(request->getMethodType() == HttpMethod_Post) { }