473,408 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

browse for file in javascript?

I have a script that replaces the content of a container on a webpage. What I would like to do is browse to a file and select it. What I do now is type the info in but would like to automate it more. In asp I can browse to a file from my admin page select the file and it posts the first few lines of the text with a more link. can I do this in javascript?
Jul 26 '13 #1
3 2739
Dormilich
8,658 Expert Mod 8TB
are you talking about files on a server or files on your local machine?

for the former, you need a server side language for assistance, for the latter, hm, not through the browser. but tdifferent OS’s have the possibility to write desktop apps in JS.
Jul 26 '13 #2
On my webserver. It is in my home but I get to it by www. Can't I browse for a file in java script. Maybe something like this
Expand|Select|Wrap|Line Numbers
  1. function openfile(file) {
  2.  
  3. window.location = "file:///" + file;
  4.  
I Know it has this
Expand|Select|Wrap|Line Numbers
  1. <input type="file"> 
but not sure how to work it.
Maybe I am going at this wrong? I have a script that changes the text in a container on my webpage but I have to navigate to the folder and open the script and type in the text hit a button that changes the text. If I have 6 text areas about 6 things I do it 6 times. I want to do this from 1 page instead of 6.
Jul 26 '13 #3
Dormilich
8,658 Expert Mod 8TB
On my webserver.
client-side JavaScript cannot do work on the server, period. (think of what would happen if you (resp. anyone else) could)

Expand|Select|Wrap|Line Numbers
  1. function openfile(file) {
  2. window.location = "file:///" + file;
that is not related to a webserver (they use HTTP), however, check out the FileReader API.
Jul 26 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Dave Smithz | last post by:
OK, not strictly a PHP problem I guess but it occurred in my PHP project and I could not find a suitable Javascript NG (under pressure, already extended deadline. I user a "file" input type on a...
1
by: Bo Dudek | last post by:
Hi I have this thought, that I'd like to share: Sometimes I'm using javascript in my webpages to create different kind of form-interactions. Sometimes I have an inputfield, and in this field...
4
by: Nick | last post by:
For example, I have the following code: <img src="photo_ring_r1_c1.jpg" title="" alt="Rings" style="width: 200px; height: 150px;" usemap="#photo_ring_r1_c1"> <map name="photo_ring_r1_c1"> <area...
2
by: Anita C | last post by:
Hi, On the click of a button I want to be able to display a dialog so that a file can be picked , the name of which needs to be passed to a function as a parameter in my asp.net app.. However for...
3
by: den 2005 | last post by:
Hi everybody, I like to allow user to select and browse to which location to save the pdf file of a crystal report viewed on a web page, how can i do this in ASP.Net? I need to get the path...
11
by: TJM | last post by:
Hi, A Javascript error is generated when the user types a few character in an INPUT TYPE=FILE and hits a submit button. The form does not post. Is there a solution to this problem? Thanks TJM
3
by: ApexData | last post by:
I am using code from the following links to establish a Browse File and Browse Folder dialog. http://www.mvps.org/access/api/api0001.htm http://www.mvps.org/access/api/api0002.htm This code...
3
by: =?Utf-8?B?UGhpbCBKb2huc29u?= | last post by:
Hi, This is an issue that happens to me and everybody else I know and I've never found a way around it. In Visual Studio (currently using 2003 but the same has happened for me in 2005 and...
0
by: najmi | last post by:
hai. i have one problem that is to upload file..it working perfectly in my computer but fail when deploy at server..the system is to browse the file,then system will zip it before upload it to the...
3
by: prashantdixit | last post by:
Hi, I have a form "FormA" which three browse button and texbox control. There two radio buttons at the top with option option1: Auto option2: Manual These option decides how to select a...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.