473,769 Members | 5,862 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Parsing a local file

I have a web app that needs to parse through a file that is located on the
client machine. I get the file string from a query string & then parse it.
It is working fine on my development box but when I put it out on the test
server the application is looking for the file on the server & not on the
client machine.

I am essentially taking the query string & using a stream reader to read the
file.

I'm sure i'm doing something whacky...so PLEASE set me straight!

Steve.
Jul 21 '05 #1
20 2008
Steve,

Accessing a file on a client is terrible difficult and I don't know how it
is prevented today.

There is a special (VBS object) for that.
http://msdn.microsoft.com/library/de...gWithFiles.asp

Cor
Jul 21 '05 #2
Browser security is going to prevent you from reading/writing
local files on the visitors PC. You are SOL unless you
write an ActiveX control, get the users to install it, and then
have them set their browser security settings to essentially
non-existant security.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:0A******** *************** ***********@mic rosoft.com...
I have a web app that needs to parse through a file that is located on the
client machine. I get the file string from a query string & then parse
it.
It is working fine on my development box but when I put it out on the test
server the application is looking for the file on the server & not on the
client machine.

I am essentially taking the query string & using a stream reader to read
the
file.

I'm sure i'm doing something whacky...so PLEASE set me straight!

Steve.

Jul 21 '05 #3
I do have control over the clients....i mean I can have the clients give
access to aspnet to a specific folder, etc... would this help?

"Steve" wrote:
I have a web app that needs to parse through a file that is located on the
client machine. I get the file string from a query string & then parse it.
It is working fine on my development box but when I put it out on the test
server the application is looking for the file on the server & not on the
client machine.

I am essentially taking the query string & using a stream reader to read the
file.

I'm sure i'm doing something whacky...so PLEASE set me straight!

Steve.

Jul 21 '05 #4
Nothing to do with ASP.NET. You'd have to lower each of
their security settings in the browser to the lowest level possible.
Even then, the browser might not enable you to do this.

Why is it that you need to read/write a local file? Perhaps
you can achieve your goal another way.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
I do have control over the clients....i mean I can have the clients give
access to aspnet to a specific folder, etc... would this help?

"Steve" wrote:
I have a web app that needs to parse through a file that is located on
the
client machine. I get the file string from a query string & then parse
it.
It is working fine on my development box but when I put it out on the
test
server the application is looking for the file on the server & not on the
client machine.

I am essentially taking the query string & using a stream reader to read
the
file.

I'm sure i'm doing something whacky...so PLEASE set me straight!

Steve.

Jul 21 '05 #5
Ya.... a local file on the clients machine. I can't install anything to the
clients machine & the HTML file input control won't work either because we
don't want the users to search for the file...which is why it's getting
passed in the query string.

Any ideas?

"Robbe Morris [C# MVP]" wrote:
Nothing to do with ASP.NET. You'd have to lower each of
their security settings in the browser to the lowest level possible.
Even then, the browser might not enable you to do this.

Why is it that you need to read/write a local file? Perhaps
you can achieve your goal another way.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
I do have control over the clients....i mean I can have the clients give
access to aspnet to a specific folder, etc... would this help?

"Steve" wrote:
I have a web app that needs to parse through a file that is located on
the
client machine. I get the file string from a query string & then parse
it.
It is working fine on my development box but when I put it out on the
test
server the application is looking for the file on the server & not on the
client machine.

I am essentially taking the query string & using a stream reader to read
the
file.

I'm sure i'm doing something whacky...so PLEASE set me straight!

Steve.


Jul 21 '05 #6
Steve,
Ya.... a local file on the clients machine. I can't install anything to
the
clients machine & the HTML file input control won't work either because we
don't want the users to search for the file...which is why it's getting
passed in the query string.

Microsoft has taken maybe hundreds of millions or more in this to make it
impossible to do what you want. You want an easy solution to do this.

Just my thought,

Cor
Jul 21 '05 #7
So is there no way to set the text for the File field? Even using Java
Script? Maybe hiding the file field & setting the text & then loading
that... I don't really care where I parse the file at...I could parse it
after I upload it...the main objective is to not allow the user to have to go
& select a file because the file is being passed by another application & our
users aren't very smart...we don't want them to try to find the file.

So how about some alternatives rather than Microsoft spending millions to
not allow programmers to do this.. which isn't very helpful.

Steve.

"Cor Ligthert" wrote:
Steve,
Ya.... a local file on the clients machine. I can't install anything to
the
clients machine & the HTML file input control won't work either because we
don't want the users to search for the file...which is why it's getting
passed in the query string.

Microsoft has taken maybe hundreds of millions or more in this to make it
impossible to do what you want. You want an easy solution to do this.

Just my thought,

Cor

Jul 21 '05 #8
Think about the consequences of what you are asking.

How do I either read or write to a local file via a browser?
How do I upload a file via browser without the user explicitly doing so?

The security implications are astounding. Hackers would have (and have had)
a field day.

This is precisely why MS spent so much money (and apparently need
to spend more because their stuff still isn't as secure as it needs to be).

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:2F******** *************** ***********@mic rosoft.com...
So is there no way to set the text for the File field? Even using Java
Script? Maybe hiding the file field & setting the text & then loading
that... I don't really care where I parse the file at...I could parse it
after I upload it...the main objective is to not allow the user to have to
go
& select a file because the file is being passed by another application &
our
users aren't very smart...we don't want them to try to find the file.

So how about some alternatives rather than Microsoft spending millions to
not allow programmers to do this.. which isn't very helpful.

Steve.

"Cor Ligthert" wrote:
Steve,
> Ya.... a local file on the clients machine. I can't install anything
> to
> the
> clients machine & the HTML file input control won't work either because
> we
> don't want the users to search for the file...which is why it's getting
> passed in the query string.
>

Microsoft has taken maybe hundreds of millions or more in this to make it
impossible to do what you want. You want an easy solution to do this.

Just my thought,

Cor

Jul 21 '05 #9
You still haven't really explained why you need to read/write/upload
a file from their machine without them knowing?

What is in the file that you need a browser to have access to?

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:1A******** *************** ***********@mic rosoft.com...
Ya.... a local file on the clients machine. I can't install anything to
the
clients machine & the HTML file input control won't work either because we
don't want the users to search for the file...which is why it's getting
passed in the query string.

Any ideas?

"Robbe Morris [C# MVP]" wrote:
Nothing to do with ASP.NET. You'd have to lower each of
their security settings in the browser to the lowest level possible.
Even then, the browser might not enable you to do this.

Why is it that you need to read/write a local file? Perhaps
you can achieve your goal another way.

--
2004 and 2005 Microsoft MVP C#
Robbe Morris
http://www.robbemorris.com
http://www.masterado.net/home/listings.aspx

"Steve" <St***@discussi ons.microsoft.c om> wrote in message
news:8C******** *************** ***********@mic rosoft.com...
>I do have control over the clients....i mean I can have the clients give
> access to aspnet to a specific folder, etc... would this help?
>
> "Steve" wrote:
>
>> I have a web app that needs to parse through a file that is located on
>> the
>> client machine. I get the file string from a query string & then
>> parse
>> it.
>> It is working fine on my development box but when I put it out on the
>> test
>> server the application is looking for the file on the server & not on
>> the
>> client machine.
>>
>> I am essentially taking the query string & using a stream reader to
>> read
>> the
>> file.
>>
>> I'm sure i'm doing something whacky...so PLEASE set me straight!
>>
>> Steve.


Jul 21 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
4271
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards as much as possible, so I'd like to call Xerces under the JAXP API. I'd like to validate the XML against a DTD, so that errors are flagged up to the user, and I can transcribe
9
2872
by: g.kanaka.raju | last post by:
Hi, I wanted to write a function that gets the file path as an argument. The file path make take one of the two forms : (i) Absolute file path e.g., /usr/local/file.log or (ii)it may be $USRLOCAL/file.${EXT} where USRLOCAL=/usr/local and $EXT=log
2
1480
by: Brett | last post by:
I uploaded an ASP.NET website from my developer machine to a remote server. The paths differ slightly as follows: Local Path: C:\Inetpub\wwwroot\mysite Server Path: C:\Inetpub\mysite.com\ I get the following error on the server:
20
295
by: Steve | last post by:
I have a web app that needs to parse through a file that is located on the client machine. I get the file string from a query string & then parse it. It is working fine on my development box but when I put it out on the test server the application is looking for the file on the server & not on the client machine. I am essentially taking the query string & using a stream reader to read the file. I'm sure i'm doing something...
8
2943
by: Eric Anderson | last post by:
I have some files that sit on a FTP server. These files contain data stored in a tab-separated format. I need to download these files and insert/update them in a MySQL database. My current basic strategy is to do the following: 1) Login to the ftp server using the FTP library in PHP 2) Create a variable that acts like a file handle using Stream_Var in PEAR. 3) Use ftp_fget() to read a remote file into this variable (this is so I don't...
1
2298
by: Thomas Kowalski | last post by:
Hi, I have to parse a plain, ascii text file (on local HD). Since the file might be many millions lines long I want to improve the efficiency of my parsing process. The resulting data structure shall look like this the following: class A { ... int value; }
0
1138
by: Uncle Leo | last post by:
I created an OleDbDataAdapter with the wizard in Visual Studio 2003. It created a dataset, connectionstring etc. for me to work with. It also created a .xsd file where one of the columns type is set to date. My program is being used in many different countries, and many different local settings. Some time ago a user from Turkey contacted me saying my program crashed on his system with the following error code: System.ArgumentException:...
0
1200
by: savj14 | last post by:
I have been driving myself crazy the past few days trying to figure this out. I have tried different Parsing Scripts and have read and searched various things trying to find a solution. I am officially lost. What I want to do is list some of My Xbox Live info on my Website. I found a Website where most of my information is stored as an XML File. This website is found here...
1
3502
by: Sidhartha | last post by:
Hi, I am facing a problem while parsing local language characters using sax parser. We use DOM to parse and SAX to read the source. But when our application parses strings with local language especially czech,polish,turkish in place of local language character some other word is comming. Eg: Input string :ahoj, jak se máš Output string :ahoj, jak se m&aacute;š
0
10032
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9979
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8861
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7393
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6661
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5293
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5433
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.