Read client file server-side

M

Michael

I am trying to open a file on the client machine from an aspx page running
server side. The design requirements of the page specify that the
HtmlInputFile control is not to be used.

Since the HtmlInputFile has an HttpPostedFile object containing the client
side path to the selected file, there must be some way to resolve this path
server side allowing me to open the file with as Stream object..

I've been looking at WebClient.OpenRead, specifying
file://c:\clienddir\file.txt as the uri, but run into a file not found
error.

How exactly does one map a client side path so the server can access it?


Michael White
Programmer/Analyst
Marion County, OR
 
I

IPGrunt

I am trying to open a file on the client machine from an aspx page running
server side. The design requirements of the page specify that the
HtmlInputFile control is not to be used.

Since the HtmlInputFile has an HttpPostedFile object containing the client
side path to the selected file, there must be some way to resolve this path
server side allowing me to open the file with as Stream object..

I've been looking at WebClient.OpenRead, specifying
file://c:\clienddir\file.txt as the uri, but run into a file not found
error.

How exactly does one map a client side path so the server can access it?


Michael White
Programmer/Analyst
Marion County, OR


WebClient.OpenRead transfers from server to client

Perhaps you want to use WebClient.UploadFile?

The documentation describes it as:

"Uploads a local file to a resource with the specified URI."



-- ipgrunt
 
M

Michael

Thanks for the reply..

I don't want to upload the file, just open it from server side code.
 
B

bruce barker

the are only a couple ways to open from the server side:

1) the client provides a its own webserver the server can hit.
2) the client creates a network share and allows the server to access it
3) the client supports a ftp server and allows access from the server.
4) the client installs some program that opens a socket to the server and
allows uploads from the server.
5) you write an unsigned active/x control and convince the client to install
and run it.

-- bruce (sqlwork.com)




way to open from the server side
"Michael" <xxx.xxx.xxx> wrote in message
| I am trying to open a file on the client machine from an aspx page running
| server side. The design requirements of the page specify that the
| HtmlInputFile control is not to be used.
|
| Since the HtmlInputFile has an HttpPostedFile object containing the client
| side path to the selected file, there must be some way to resolve this
path
| server side allowing me to open the file with as Stream object..
|
| I've been looking at WebClient.OpenRead, specifying
| file://c:\clienddir\file.txt as the uri, but run into a file not found
| error.
|
| How exactly does one map a client side path so the server can access it?
|
|
| Michael White
| Programmer/Analyst
| Marion County, OR
|
|
 
I

IPGrunt

Thanks for the reply..

I don't want to upload the file, just open it from server side code.

Yes Michael, you must understand is not a peer-to-peer protocol and not
designed for server processes to open client files. Can you imagine if any
server process could open the files on your local machine while you were
connected to their website? (that's called malware).

Many experienced client/server developers come to website development and
get frustrated by the apparent lack of connectivity, however, HTTP works
on request/response for many good reasons, primarily to protect the
security of both client and server.

I'm not sure what you want to do, but perhaps HTTP is NOT the protocol you
need.

-- ipgrunt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,152
Latest member
LorettaGur
Top