473,554 Members | 2,299 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading file from Client instead of Server

SAL
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
if you have some sample code I can look at that would be great.

Thanks,

Oct 24 '06 #1
12 2866
I dont think this is possible. The only processing that can be done on
the client is through Javascript and Javascript cannot read from files.

Why are you trying to accomplish all of this on the client?

Jeff
SAL wrote:
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
if you have some sample code I can look at that would be great.

Thanks,
Oct 24 '06 #2
You can find a file on the client's file system if you use WSH (Windows
Scripting Host). You would need to set special security on each client
browser.

Asp.Net databinding is a pure server-side functionality. You can't do it on
client.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SAL" <SA*@discussion s.microsoft.com wrote in message
news:31******** *************** ***********@mic rosoft.com...
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net
so
if you have some sample code I can look at that would be great.

Thanks,

Oct 24 '06 #3
SAL
Because I want to allow the user to make edits to the data if they have to
before I save the data to a SQL Server DB.

"Jeff" wrote:
I dont think this is possible. The only processing that can be done on
the client is through Javascript and Javascript cannot read from files.

Why are you trying to accomplish all of this on the client?

Jeff
SAL wrote:
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
if you have some sample code I can look at that would be great.

Thanks,

Oct 24 '06 #4
SAL
Currently I have a System.Web.UI.H tmlControls.Htm lInputFile control on my
Webform that allows the user to find their CSV file, and I read that CSV file
into a Data Table. I then send that Data Table in my Class back to my ASPX,
and store it in a Data View then bind my DataGrid to that Data View.

I thought this would work without uploading the file to the Server, because
I didn't want to manage these files on the Server when I was done with them.

"Eliyahu Goldin" wrote:
You can find a file on the client's file system if you use WSH (Windows
Scripting Host). You would need to set special security on each client
browser.

Asp.Net databinding is a pure server-side functionality. You can't do it on
client.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SAL" <SA*@discussion s.microsoft.com wrote in message
news:31******** *************** ***********@mic rosoft.com...
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net
so
if you have some sample code I can look at that would be great.

Thanks,


Oct 24 '06 #5
Jay
Save your file in the database with an extra argument so it's not shown
by defailt (status var) or save the file on the server linked to the
client's IP address

SAL wrote:
Because I want to allow the user to make edits to the data if they have to
before I save the data to a SQL Server DB.
Oct 24 '06 #6
You can also upload the file to the server to do all that you want to
do with it and then delete it as soon as your finished using it or when
the session ends.

SAL wrote:
Currently I have a System.Web.UI.H tmlControls.Htm lInputFile control on my
Webform that allows the user to find their CSV file, and I read that CSV file
into a Data Table. I then send that Data Table in my Class back to my ASPX,
and store it in a Data View then bind my DataGrid to that Data View.

I thought this would work without uploading the file to the Server, because
I didn't want to manage these files on the Server when I was done with them.

"Eliyahu Goldin" wrote:
You can find a file on the client's file system if you use WSH (Windows
Scripting Host). You would need to set special security on each client
browser.

Asp.Net databinding is a pure server-side functionality. You can't do it on
client.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SAL" <SA*@discussion s.microsoft.com wrote in message
news:31******** *************** ***********@mic rosoft.com...
Hello,
>
Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?
>
I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.
>
Has anyone done this before? If so, how do I do it? I'm new to ASP.net
so
if you have some sample code I can look at that would be great.
>
Thanks,
>
Oct 24 '06 #7
SAL
Hi Jay,

How would I save the file on the server linked to the client's IP address?

I'm fairly new at C# and ASP.net, so if you have a code snippet I can look
at that would be great.

Would this file automatically be dispose of when the client existed their
browser or would I still need to manage this file and delete it when I was
done with it?

"Jay" wrote:
Save your file in the database with an extra argument so it's not shown
by defailt (status var) or save the file on the server linked to the
client's IP address

SAL wrote:
Because I want to allow the user to make edits to the data if they have to
before I save the data to a SQL Server DB.

Oct 24 '06 #8
What you describe sounds like it should work.

What exactly isn't working about it?

How are you converting the CSV to DataTable?

Here is an example of what you want to do using a CSV reader 3rd party
library (there are other ways..but you asked for source code example).

http://www.csvreader.com/csv_samples.php

Note that instead of saving to the database, you would send the data
table into your class as you describe in your post.

HTH.
SAL wrote:
Currently I have a System.Web.UI.H tmlControls.Htm lInputFile control on my
Webform that allows the user to find their CSV file, and I read that CSV file
into a Data Table. I then send that Data Table in my Class back to my ASPX,
and store it in a Data View then bind my DataGrid to that Data View.

I thought this would work without uploading the file to the Server, because
I didn't want to manage these files on the Server when I was done with them.

"Eliyahu Goldin" wrote:
You can find a file on the client's file system if you use WSH (Windows
Scripting Host). You would need to set special security on each client
browser.

Asp.Net databinding is a pure server-side functionality. You can't do it on
client.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
"SAL" <SA*@discussion s.microsoft.com wrote in message
news:31******** *************** ***********@mic rosoft.com...
Hello,
>
Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?
>
I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.
>
Has anyone done this before? If so, how do I do it? I'm new to ASP.net
so
if you have some sample code I can look at that would be great.
>
Thanks,
>
Oct 24 '06 #9
SAL
I am using the that snippet code you pointed me to in my Webform.

As for what exactly isn't working, it assume the file the user selected at
the client was uploaded to the server, and gives a general error message that
says something like the path to the file you specified doesn't exist.

I just assumed that if I read the CSV file from the Client into a Data
Table, that the Data Table reference with all it's data would have been
passed to the server, instead of trying to find the CSV file on the Server.

"xAvailx" wrote:
What you describe sounds like it should work.

What exactly isn't working about it?

How are you converting the CSV to DataTable?

Here is an example of what you want to do using a CSV reader 3rd party
library (there are other ways..but you asked for source code example).

http://www.csvreader.com/csv_samples.php

Note that instead of saving to the database, you would send the data
table into your class as you describe in your post.

HTH.
SAL wrote:
Currently I have a System.Web.UI.H tmlControls.Htm lInputFile control on my
Webform that allows the user to find their CSV file, and I read that CSV file
into a Data Table. I then send that Data Table in my Class back to my ASPX,
and store it in a Data View then bind my DataGrid to that Data View.

I thought this would work without uploading the file to the Server, because
I didn't want to manage these files on the Server when I was done with them.

"Eliyahu Goldin" wrote:
You can find a file on the client's file system if you use WSH (Windows
Scripting Host). You would need to set special security on each client
browser.
>
Asp.Net databinding is a pure server-side functionality. You can't do it on
client.
>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
>
>
"SAL" <SA*@discussion s.microsoft.com wrote in message
news:31******** *************** ***********@mic rosoft.com...
Hello,

Is it possible to read a CSV from the Client, and bind my Datagrid to the
data in the CSV file without uploading the file to the Server first?

I have tried and in Debug mode on my workstation it works fine, but when I
publish the page on our DEV server it doesn't fine the CSV file from the
client.

Has anyone done this before? If so, how do I do it? I'm new to ASP.net
so
if you have some sample code I can look at that would be great.

Thanks,

>
>
>

Oct 24 '06 #10

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

Similar topics

20
2450
by: CHIN | last post by:
Hi all.. here s my problem ( maybe some of you saw me on other groups, but i cant find the solution !! ) I have to upload a file to an external site, so, i made a .vbs file , that logins to the site, and then i have to select the file to upload.. i used sendkeys.. and i worked perfect.. BUT ... the computer must be locked for security (...
3
2276
by: Steven Burn | last post by:
The application; Service on my webserver that allows a user to upload their HOSTS file for functions to verify the contents are still valid. Uses; 1. XMLHTTP (MSXML2) 2. FileSystemObject 3. CrazyBeavers Upload control (couldn't get the Dundas one to work)
1
4366
by: Michael Palmer | last post by:
I'm reading xml from SQL Server 2K with VB.net using an XSD schema file and SQLXML 3.0. I have the below code working fine, but I'd like to change the code from reading the schema file from a directory to reading the schema as an embedded resource. Here's my current code, what would I need to change?? Dim strm As Stream Dim strmReader As...
1
2843
by: Paul Fi | last post by:
I have this problem with .NET remoting: my remote class is called RemoteHandler which implements an interface called IEazyRemoting which has only one method to be implemented which is my server configuration file looks like this: <configuration> <system.runtime.remoting> <application> <service>
2
1414
by: archana | last post by:
Hi all, I am new to asp.net (learning phase). I have to develop application in asp.net to read file from client pc and display statistics of that file to client. So my question is that to read file from client pc do i need to upload that file on server and then start reading that file. Or is there any other alternative for this.
4
2375
by: News | last post by:
Hi Everyone, The attached code creates client connections to websphere queue managers and then processes an inquiry against them. The program functions when it gets options from the command line. It also works when pulling the options from a file.
3
1591
by: John | last post by:
How can I tell if a line begins with a number instead of a character? I need to read a text file and some of the data begins with a character which is causing me an issue in reading and uploading my file. I only need the data if it begins with a number (numeric) value.
1
6455
by: laredotornado | last post by:
Hi, I'm using PHP 4.4.4 on Apache 2 on Fedora Core 5. PHP was installed using Apache's apxs and the php library was installed to /usr/local/php. However, when I set my "error_reporting" setting to be "E_ALL", notices are still not getting reported. The perms on my file are 664, with owner root and group root. The php.ini file is located...
0
7612
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7536
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7814
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7895
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5443
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...
0
5165
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...
0
3564
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2027
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
0
853
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...

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.