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 4 3886
"Michael" <xxx.xxx.xxx> confessed in news:eSA$fhvDFHA.3888
@TK2MSFTNGP09.phx.gbl: 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
Thanks for the reply..
I don't want to upload the file, just open it from server side code.
"IPGrunt" <me@privacy.net> wrote in message
news:Xn**********************************@130.133. 1.4... "Michael" <xxx.xxx.xxx> confessed in news:eSA$fhvDFHA.3888 @TK2MSFTNGP09.phx.gbl:
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
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
news:eS**************@TK2MSFTNGP09.phx.gbl...
| 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
|
|
"Michael" <xxx.xxx.xxx> confessed in news:OCkJN8vDFHA.2568
@TK2MSFTNGP10.phx.gbl: Thanks for the reply..
I don't want to upload the file, just open it from server side code.
"IPGrunt" <me@privacy.net> wrote in message news:Xn**********************************@130.133. 1.4... "Michael" <xxx.xxx.xxx> confessed in news:eSA$fhvDFHA.3888 @TK2MSFTNGP09.phx.gbl:
> 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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: IndianOZ |
last post by:
Hi ,
I'm trying to send an Image over the Socket Connection (from the
Client using winsock, which is a VB based client) and at the other end
I'm reading the Stream (at the Server which is java...
|
by: Hai Ly Hoang \(MT00KSTN\) |
last post by:
Hi,
FileStream.Read(buf, offset, siz) will return when reaching the end of file
or a block (size siz) can be read from the file. In the case of
NetworkStream, it's more confusing. Now, consider...
|
by: John Howard |
last post by:
How can I read a text file that is on a UNIX server in VB.Net?
Please keep it simple.
Thanks,
John
|
by: Lisa Pearlson |
last post by:
Hi,
I am wanting to write an internet 'server' program. For ease, I want to use
PHP-CLI with XINET super server.
XINET communicates with the 'server' program via STDIN/STDOUT.
I'm not sure...
|
by: archana |
last post by:
Hi all,
I am new to asp.net. I heard somthing like we can't open file which is
there on client pc without uploading that file onto out server.
Is it right? If i am wrong then please correct...
|
by: phplasma |
last post by:
Hey,
I am currently attempting to implement a multi-threaded C# socket,
using SSL (.pem file/certification/private key combo) server using
Visual Studio C# Express.
I have successfully made...
|
by: dosworldguy |
last post by:
I have been having a very peculiar issue from a long time.
I have an application where multiple clients read from a shared set of
files. When a record is changed, sometimes the win9x clients...
|
by: Big Charles |
last post by:
Hello,
My ASP.NET application has to read a DBF file in a CD from CD-Drive of
a client PC. Then, I have to pass the data to a DataReader.
The route is: Client-PC -Server
The DBF file could be...
|
by: Jens |
last post by:
Hello,
I have been looking for some C-code which listens on a user-defined port
for incoming data traffic. When data is received, the data is written to a
file.
I found some C-code (server)...
|
by: Johnny |
last post by:
Hi all:
I have an ASP.NET form that reads an Excel file and populates a datagrid. If
I load the form in IE on the server, and select a local file, the code works
fine. However if I load the form...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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...
|
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...
|
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...
| |