|
Does anybody know how to read a file using javascript
I have tried but it seems not to work
fh = fopen("filepath", 0);
if(fh!=-1)
{<br />
length = flength(fh);
str = fread(fh, length);
fclose(fh);
<br />
write(str); <br />
}<br />
-- modified at 10:48 Monday 10th July, 2006
|
|
|
|
|
If you are running this through a web page you probably won't have permissions to open a client's file system.
|
|
|
|
|
I have an input element of type file, so i can get the file path on the client side, but i dont know how to read the file on the client's side.
Im using Jboss as my container, and im using JSPs.
Any help.
|
|
|
|
|
That doesn't work.
If you run the Javascript in the browser, you can't access any file system.
If you run the Javascript in the server, you can't access the file system of the client, only the server.
---
b { font-weight: normal; }
|
|
|
|
|
Yeah, you'll have to upload to the server and do something with the file there. You can't use JavaScript to read files on a client machine. I think that Flash might be able to do that.. anyone seen this lately?
Dirk Watkins
|
|
|
|
|
Javascript and VBScript are ONLY able to access files on your hard drive using Active X controls.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
As far as I am aware, javascript is forbidden access to your file system except by using an Active X control. In which case, taken from an older version of JScript :
OpenTextFile Method
=============================
var fs, a, ForAppending;
ForAppending = 8;
fs = new ActiveXObject("Scripting.FileSystemObject");
a = fs.OpenTextFile("c:\\testfile.txt", ForAppending, false);
...
a.Close()
FileExists method
=========================
function ReportFileStatus(filespec)
{
var fso, s = filespec;
fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FileExists(filespec))
s += " exists.";
else
s += " doesn't exist.";
return(s);
}
Write method:
=============================
function WriteDemo()
{
var fso, f, r
var ForReading = 1, ForWriting = 2;
fso = new ActiveXObject("Scripting.FileSystemObject")
f = fso.OpenTextFile("c:\\testfile.txt", ForWriting, true)
f.Write("Hello world!");
f.Close();
f = fso.OpenTextFile("c:\\testfile.txt", ForReading);
r = f.ReadLine();
return(r);
}
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Hi,
Is there a way for people to share a file like a ms-Word doc
and assign one party permission to view it while another party could edit it
while other is viewing ?
|
|
|
|
|
We are building a Client/Server application based on ASP.NET.
The server application is an IIS 6.0 hosted XML web service application exposing various web service methods.
The client is a Windows Forms client which are consuming the XML web services.
It's very important the application is available 24 hours a day and therefore we rely on the Worker Process Isolation/recycling feature in IIS 6.0 for maximum availibility.
Unforetunely recycling does not work very well for us - the client hangs if recycling happens during a web service request. After some amount of time we get the WebException "The operation has timed out". On the IIS6.0 machine we see the old worker process has been killed. If a new request is made to the service, a new worker process starts up and the application continues working. So the server side is apparently completely unaware of the hanging client.
To find the root cause I developed the most simple test application which consists of a ASP.Net web service exposing a single web method and a Console application which consumes this Web service in an infinite loop:
Server:
using System;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Service : System.Web.Services.WebService
{
[WebMethod]
public void test()
{
int v = 10;
}
}
Client:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
WebReference.Service s = new ConsoleApplication1.WebReference.Service();
int j = 0;
while (true)
{
s.test();
Console.WriteLine(j.ToString());
j++;
}
}
}
}
If I manually recycle the Application pool running the web service above, the Console application starts hanging until the time out exception occurs. Anybody got an idea why this happens? I thought recycling was supposed to be transparent for the client.
The IIS 6.0 is configured with default settings.
In the HTTPErr log file I get a Timer_AppPool error. I guess this indicates that a request from the console application somehow gets stuck?
Thanks & Regards
Steen Bundgaard
|
|
|
|
|
Hello, does anybody know how to open an "open file dialog box" in javascript?
|
|
|
|
|
You use a tag like this: ...
|
|
|
|
|
hi,
plz try this code for that its helpfull for u
<title>Change the URL
Pick your favorite investment site:
Fool.com (The Motley Fool)
MoneyCentral Investor
TheStreet.com
|
|
|
|
|
Hello
I'm making a project in ASP.Net 1.1.
Basically its Site Creator Project on which i' working.
My CLient hav uploaded the 20 subdoamin for me.
but i don't how to use these subdoamin either i have to upload my whole project on these 20 subdoamins. or is there any way which i can set the path to my mail domain directly.
i hope i'm able to let u understand my problem.if any thing unclear plz let me know.
thanx
|
|
|
|
|
You can use the host headers in IIS to do this and have them all point to the same site so you will only need one set of code.
Dirk Watkins
|
|
|
|
|
hi
thanx for replying but didn't get ur answer properly it would be better to me if u write the answer little descriptive..(plz explain more)
thanx
|
|
|
|
|
|
|
for example if there is a flash. why it's locked by the browser.
and the problem is i saw some flash on other websites not locked.
how can i remove this blocker... ??
Faris Madi
Nothing Comes Easy (N.C.E.)
|
|
|
|
|
|
thanx, but what's the reasons to disactivate the control.
Is it for security reasons?
Faris Madi
Nothing Comes Easy (N.C.E.)
-- modified at 2:28 Tuesday 11th July, 2006
|
|
|
|
|
Microsoft lost a lawsuit regarding the embedding of content. This was its initial attempt at a work around. Rumor has it that will change in IE7 (surprise...surprise)
|
|
|
|
|
Hi
I am developing a website in JSP. I want to create a container window as the result of pressing some button. This window can contain multiple dialog boxes arranged in some way, like 3 dialog boxes in a row. Now i dont know what kind of window can be used as this type of container and how can i place a dialog box in it. Please can anyone help me in this regard.
Thanks
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
Hi All,
I have developing the windows project. In this project I want to send a pdf file after adding the Digital Signature. and when we retrive same file i check that this file is modofied or not and also check that This file was sended by me or not.
how to do this?
Adding the Signature is done with CAPICOM but Using CAPICOM we check that file is modified ot not?
Please help me.
Thanks in advance
Chetan Visodiya
-- modified at 2:28 Monday 10th July, 2006
|
|
|
|
|
If you have 3 columns in one table, and place in the first TD 100px, in tha last 200px and in the middle TD one asterisk "*", the middle column enlarge to fit the table width.
I can use this asterisk (*) in css? The asterisk is reserved in css, then what we can use?
Regards
Jesus is Love! Tell to someone!
|
|
|
|
|
I may be wrong here, but do you need this asterisk at all. If you have two columns of fixed width and a set width on the table, then surely the middle column will expand to the table width anyway...
|
|
|
|